Reputation: 1
I am new to Logic Apps and trying to get a good understanding of it by getting hands on and reading. I have created a few apps now and it is making more sense each time. The problem i am having is that i can create a new Dynamics record in one action, retrieve the primary key it generated in another action. But how do i use this primary value in another action to create a related record in another action. There doesn't seem to be away to store or assign variables or modify parameters on the fly?
Upvotes: 0
Views: 8257
Reputation: 111
Let us assume that your logic app action for creating Dynamics Record is "CreateRecord". And it produces an output like this
{
"primarykey" : "<guid>"
}
You can access the output of this action like this
@body('CreateRecord').primarykey
OR
@body('CreateRecord')['primarykey']
Upvotes: 1
Reputation: 99
variables are now supported in logic app, they are available in actions, first you need to initialize your variable(currently supported types are Boolean, Integer, String, Float, object, Array) and perform the desired actions on them and also modify them.
Upvotes: 3
Reputation: 31
Variables for Logic Apps have now been released, as of 24th March 2017. However they only currently support integers and floats, and you can only initialize or increment them. Support for string variables, and modifying them after initialization will be coming soon. You can create them via the new Variable action.
Upvotes: 3
Reputation: 43
You can use "type": "Compose" in an action to set a variable eg:
"IsMissing": {
"type": "Compose",
"inputs": {
"what": "Something is missing"
},
"runAfter": {}
}
}
then use body('IsMissing') to use this variable.
Upvotes: 1