So I am working on my database where I need to call extrenal API and get contact enrichment I was able to connect to the extrnal API and was able to receive a code:200 but now the issue is I cant map it back to my database as the HTTP Module is not shown in the next modules how can this be fixed ?
So I figured out the issue, I had to run the Python script to fix the issue but how ever I am able to receive the data in my python script but I am not able to print it any help here would be appreciated.
I am able to get the output from the script that I am running but the ouput is not delimated as json output which is not mapable in the next stage what is the solution to this issue ?
Hi Burhan,
Hmm, not sure I fully get what you mean by “not delimited as JSON output” – the screenshot shows your Run Script output is already a JSON object, and the HTTP response looks properly formatted too.
Maybe check how you’re accessing the data in the next step? Here’s a quick demo of using script output values downstream:
Could you head back to the Run Script Action editor and click “Run Test” again? Wait for the HTTP response to show up, then close that editor. Now reopen your Update Record editor and check if the data variable pops up in the variable picker?
The variable list automatically updates based on the latest “Run Test” results from each action, so sometimes we gotta give it another click when stuff changes. Let me know if that works!
Yes by runing the test run it worked and data is populated, I was actually running the whole automation again even for testing. Anyhow thankyou so much for your support but I need it again as I am stuck in the next step now to map the data with the record.
So the current senario is Trigger > Script > update record. When the automation reaches update record it actually just pulls the current data in the row and wont update the data pulled from the script command. Need your support to map the data correctly unique identifier will be the linkedin link. Here is the screenshot in how I have set it up.
From your “Update Record Action” setup, it looks like it’s only updating the first record in your “Canada Sales Contact” database.
I think you want to use the LinkedIn link to find and update the specific record where linkedin_link matches the one from your Script/Trigger, right?
Quick fix: Add a “Get Record” action before the “Update Record” step. Set its filter to {Canada_Sales_Contact.linkedin_link} = {Script.linkedin_link}. Then in your “Update Record” action, use the Record ID from this “Get Record” output as the target record. Just make sure only one record matches that LinkedIn link, otherwise the automation might get stuck.
I request connecting with you and fix this issue as its more than a week now I am stuck at this stage appreciate your help but please let us finalize this ASAP.
really sorry you’re still stuck on this! Since this comunity is meant for sharing knowledge, I can’t offer one-on-one connection here.
Could you help me help you faster? If you could record a quick video (maybe using something like Vimeo) showing your screen while walking me through the error - especially the Run History results and your Find Record Action configuration - that’d be super helpful. The more details you can share, the better chance we have to figure this out together!
Hi sorry if that’s a little off-topic here, but I’m trying to figure out how to perform complex checks on the received data with Python. My example here is that the Send HTTP Request Node received some JSON data. But trying to import that into the Python script node fails with error 500:
What I need is just to check the if the word “check” is seen anywhere in the data. First I tried that more straightforward way:
Hi sorry if that’s a little off-topic here, but I’m trying to figure out how to perform complex checks on the received data with Python. My example here is that the HTTP Request Node received some JSON data. But trying to import that into the Python script node fails with error 500:
What I need is just to check the if the word “check” is seen anywhere in the data. First I tried that more straightforward way:
str0="check"
nostroy="<%= JSON.stringify(_actions.actpDNscAT1IoBoQMeACTvDO.body) %>"
if str0 in nostroy:
data = "yes"
else:
data = "no"
But it doesn’t like the way I’m trying to import the data and falls with 500. Then I tried this way but also no luck:
import json
str0="check"
nostroy=json.loads("<%= JSON.stringify(_actions.actpDNscAT1IoBoQMeACTvDO.body) %>")
text_nostroy = json.dumps(nostroy, indent=4)
if str0 in nostroy:
data = "yes"
else:
data = "no"
Then I tried to mimick the snippet in this thread (with the manual definition of the inn variable which is a search term):
It still ends with error 500.
So my questions are: is there any restriction on what data can be imported into variables? How can we actually debug - like at least have some error description of why Python has failed? What would be the correct way to perform the following logic:
We receive a value from the trigger which is written to variable inn
We make a request to the API here https://reestr.nopriz.ru/api/sro/all/member/list/
no headers needed, and the parameters are as follows:
params = {
“page”: 1,
“sortBy”: {},
“filters”: {},
“pageCount”: “100”,
“searchString”: inn
}
So there are TWO entries (body>data>data>0 and body>data>data>1)
For each entry we must check the following:
Is the member_status>code = 1? if NO, then skip the entry. If yes, then does the registration_number of this entry have “2010” in it? If yes then output something if no then skip. Same checks for the second entry. I appreciate any help guys
P.S. this output is from the Send HTTP Request node, it works well but I need to somehow transfer and parse this data with conditional logic into python node
From the error it looks like a 500 on the server side, so likely not your code. How did you end up fixing it? Anything you think we should improve on our side?
As far as I understand, the Python node ends up with an error 500 every time the python code fails for whatever reason. But there is no way to check what’s the python error so no clear way to debug the code. In my particular case I still haven’t found the reason of the failing. My workaround is that one request is made via Python node and another one is via HTTP Request node, that’s it.
What to improve - I think the python console output atleast when Run Test is mandatory so we can debug effectively. Now it just shows error 500 which means that the node failed somewhere while running the code
@anp, thanks a lot for sharing the details. I’ve passed this feedback along to the product team for review. Really appreciate you taking the time to share such thoughtful input — it helps us keep improving Bika.