I’m trying my first more advanced Shortcut and running into a wall. I don’t know if it’s a bug in shortcuts or if I’m doing something wrong.
I have a process that I need to run that requires 2 curl commands. One to get an access token and another that uses that token to kick off a different process using our API.
The first part works great, and I figured out how to get the token out of the JSON that is returned by the first curl. When I try to send the second command, part of the path needs to be a variable, which I’ve called customerName. When I hardcode the path in the filename key, it works. Using the variable fails.
I added a step two copy the value of the customerName to the clipboard after I set it so I could troubleshoot, and then when I paste it in after the call fails, it’s appeneded the extra bit from the fileName key. It’s very frustrating. Any ideas for how I could make this work?
Well, I worked around it by actually using the clipboard value in the filename path key instead of the variable that should be identical. That kind of offends me on an aesthetic level, but what are you gonna do? It works.
The value of filename should be customerName/[proprietaryservice]Config.xml. The crossed out bit is the name of the Config file (which includes the name of the service being configured), but every customer’s config file is named the same. It’s just the directory name that is customer specific.
My workaround works, but I’m just wondering why setting the variable name didn’t work.
Without having a copy of the Shortcut to physically examine, it appears that, in action 2, you are setting the customerName variable to a blank. Where the action shows Input in light blue, it should say Provided Input and have the action symbol at the start: