0
votes

I have a Logic Apps instance with a variable AddedPoKey set out of parsed JSON

                            "Set_PO_Key_variable_": {
                            "inputs": {
                                "name": "AddedPoKey",
                                "value": "@{body('Parse_JSON')?['poKey']}"
                            },
                            "runAfter": {
                                "Parse_JSON": [
                                    "Succeeded"
                                ]
                            },
                            "type": "SetVariable"
                        },

I want to use the value to set the Id in a RESTful API collection resource. I have not been able to get it to work, though I am sure it should. I am possible not finding the best MS documentation on this and if any could be pointed out to me, I would appreciate it. I have tried:

                            "Set_Po_Lin_Add_url_": {
                            "inputs": {
                                "name": "CreatePoLineResourceUrl",
                                "value": "@{replace('https://api.plex.com/EDI/sales-orders/{PoKey}/lines','{PoKey}',triggerBody()['AddedPoKey'])}"
                            },
                            "runAfter": {
                                "Set_PO_Key_variable_": [
                                    "Succeeded"
                                ]
                            },
                            "type": "SetVariable"
                        }

Which results in InvalidTemplate. Unable to process template language expressions in action 'Set_Po_Lin_Add_url_' inputs at line '1' and column '2459': 'The template language expression 'replace('https://api.plex.com/EDI/sales-orders/{PoKey}/lines','{PoKey}',triggerBody()['AddedPoKey'])' cannot be evaluated because property 'AddedPoKey' doesn't exist, available properties are 'ContentData, ContentType, ContentTransferEncoding, Properties, MessageId, To, ReplyTo, ReplyToSessionId, Label, ScheduledEnqueueTimeUtc, SessionId, CorrelationId, SequenceNumber, LockToken, TimeToLive'. Please see https://aka.ms/logicexpressions for usage details.'.

1

1 Answers

1
votes

and then

"@{replace('https://api.plex.com/EDI/sales-orders/{PoKey}/lines','{PoKey}',variables('AddedPoKey')}"

which works.

Note that https://aka.ms/logicexpressions had been my main references, but does not even have the word "variable" on the page at this time.