Expand my Community achievements bar.

Join us on September 25th for a must-attend webinar featuring Adobe Experience Maker winner Anish Raul. Discover how leading enterprises are adopting AI into their workflows securely, responsibly, and at scale.

Mark Solution

This conversation has been locked due to inactivity. Please create a new post.

SOLVED

Use IF THEN ELSE statement in Attach Data Action

Avatar

Level 2

Is it possible to use IF THEN ELSE statement in Attach Data Action? 

And how should it be formed in JSON Payload?

 

For example, will it be possible to create a Context data key with value x if eventId contains "top" or "middle" otherwise have value y.

 

Any help, will be much appreciated.

Thank you

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Level 4

Hi,

   You may try to create separated rules for this case.

    One rule for "event.id" : "Something.blah.top.level".
    One rule for "date.value.middle.blah".

    Another one with two conditions negated (set logic type to Exception)

    e.g.
    CONDITIONS:

    NOT event.id contains top  AND NOT  event.id contains middle.

Thanks,

Calise
Mobile Engineer

View solution in original post

3 Replies

Avatar

Employee Advisor

So it seems like instead of "Attach Data" you want to use the "Modify Data" action. Ahead of the ACTION you would want to put a condition on the event. Or use the Mobile Core TrackAction event as your trigger. 

Avatar

Level 2

Hi Ivan,

thank you for responding.

 

I want to create a new Context data variable that it's value is dependant on the values of an existing Variable.

eg if "event.id" : "something.blah.top.level" or " data.value.middle.blah" then create a new context data variable "key" : "value"

otherwise "key" : "no_value"

 

Would that be possible?

How should it be written?

 

Thanks 

Avatar

Correct answer by
Level 4

Hi,

   You may try to create separated rules for this case.

    One rule for "event.id" : "Something.blah.top.level".
    One rule for "date.value.middle.blah".

    Another one with two conditions negated (set logic type to Exception)

    e.g.
    CONDITIONS:

    NOT event.id contains top  AND NOT  event.id contains middle.

Thanks,

Calise
Mobile Engineer