Hello, I am working on a workflow that receives text in the following format:
{
"goal": "CS229 Problem Set #2",
"due_date": "October 25 at 11:59 pm",
"class_name": "CS 229",
"monday": [
{
"Action": "Review assignment requirements",
"Start time": "10:00",
"Duration": "30 min",
"Impact": "Clarify expectations for tasks"
},
{
"Action": "Complete questions 1 and 2",
"Start time": "10:30",
"Duration": "1 hr",
"Impact": "Progress on part of the assignment"
}
],
"tuesday": [
{
"Action": "Review assignment requirements",
"Start time": "10:00",
"Duration": "30 min",
"Impact": "Clarify expectations for tasks"
},
{
"Action": "Complete questions 1 and 2",
"Start time": "10:30",
"Duration": "1 hr",
"Impact": "Progress on part of the assignment"
}
… (and so on for every day)
"friday": [
{
"Action": "Test code from questions 3 and 4",
"Start time": "2:00",
"Duration": "1 hr",
"Impact": "Validate functionality of implementations"
},
{
"Action": "Review and compile the entire assignment for submission",
"Start time": "3:00",
"Duration": "1 hr",
"Impact": "Preparation for a successful submission"
}
]
}
I would like to add all of these values to my database. I currently have a Task object that has fields Goal, Due date, Class name and a list that will contain objects of type Day, with fields Day name and a list Actions that has fields Action, Start time, Duration, and Impact.
I have tried many solutions, such as plugins and backend APIs, but all seem to come short. What’s the problem?
So above, the result of Boostability Assistant – List Messages is a text output that is formatted as a JSON. Maybe I should do something in there to better parse the information? So basically I’m taking that text output then trying to parse the individual values.
And above is the result of my API call, as you can see text value is setting the resulting JSON just to text, and I am unable to edit it’s type to something recognizable by a JSON.
Yes exactly. The text value parameter gives that JSON, and I need a way to extract all of these values and put them in my database to be used in my app.
This is with the actual response mentioned. As you can see, the value for text value is { (open bracket) followed by \n since it is a JSON. So we cannot see the full text but it is of the form as described in the original post.
Might not be the best solution but you can try this.
Set the API to use as Action (Not Data) (Eg. Get Schedule Data)
Setup a new API workflow
Add an action to call the API (Get Schedule Data)
Add another action after (From step 3), Return Data from API (Refer Screenshot)
Call the New API workflow (From step 2) from the API connector, this time in the initialise response, Bubble will automatically parse the JSON (schedule data) with respective data types.
I think I understand what you’re saying, but I’m not quite sure I’m doing it correctly.
Below is my API workflow with my Action call to retrieve the messages (Step 1 will return text as a JSON I described in the original post). I believe I am passing that value into Return data from API.
However when I run it live I run into this bizarre outcome:
As you can see below, the result of me calling Schedule API workflow results in just the number 76.