Skip to content

Commit 7c2dd85

Browse files
pinkeshmarsPoojaB26
andcommitted
Added Info for Predefined Path (#275)
* Added info for Predfined path * fix --------- Co-authored-by: Pooja Bhaumik <[email protected]>
1 parent 5b071e8 commit 7c2dd85

File tree

1 file changed

+75
-23
lines changed
  • docs/resources/control-flow/backend-logic/api

1 file changed

+75
-23
lines changed

docs/resources/control-flow/backend-logic/api/rest-api.md

Lines changed: 75 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -569,38 +569,70 @@ Learn more about **[JSONPath](https://www.rfc-editor.org/rfc/rfc9535.html)** and
569569
:::
570570

571571
### Adding JSON Path
572+
You can effortlessly define and manage **JSON Paths** for your API calls in FlutterFlow to parse and extract the data you need. Once added you can [use](#using-json-path) them as **Predefined Path** while accessing the **JSON Body**.
572573

573-
To add JSON path:
574+
First, [create and test](../api/create-test-api-calls.md) your API call. Inside the **JSON Paths** section, click **+ Add JSON Path**, enter your **JSON Path**, and assign it a name. If the expression is valid, a preview of the response appears under **Response Preview**. Click the **Preview** icon to see the full response. If the response contains a list of items, the **Is List** option will be enabled automatically.
574575

575-
1. First, [create and test](../api/create-test-api-calls.md) your API call.
576-
577-
2. Inside the **JSON Paths** section, click on the **+ Add JSON Path**.
578-
3. Enter your **JSON Path** and give it a **Name**.
579-
4. If you entered the valid expression, you'll see the starting part of the response under the **Response Preview** column. To see the complete response, click on the **Preview** icon.
580-
5. If the returned response is a list of items, by default, **Is List** will be checked; however, if you want to convert the response into the list explicitly, checkmark it.
581-
6. We also recommend all the possible JSON paths (under the **Recommended** tab) that might include what you are looking for.
582-
583-
1. To add the recommended JSON path, checkmark the **Selected**, open the **Selected** tab,
584-
and give it a name.
585-
586-
<div class="video-container"><iframe src="https://www.loom.
587-
com/embed/fb4f0f0cbdc64ecface05622a8b8cc37?sid=e82499c7-b581-4d62-a197-037ee31a14b0" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe></div>
576+
Under the **Recommended** section, you'll find suggested JSON paths that might contain the data you need.
588577

578+
<div style={{
579+
position: 'relative',
580+
paddingBottom: 'calc(56.67989417989418% + 41px)', // Keeps the aspect ratio and additional padding
581+
height: 0,
582+
width: '100%'}}>
583+
<iframe
584+
src="https://demo.arcade.software/mJBbGANYmn6SrtrByAYf?embed&show_copy_link=true"
585+
title=""
586+
style={{
587+
position: 'absolute',
588+
top: 0,
589+
left: 0,
590+
width: '100%',
591+
height: '100%',
592+
colorScheme: 'light'
593+
}}
594+
frameborder="0"
595+
loading="lazy"
596+
webkitAllowFullScreen
597+
mozAllowFullScreen
598+
allowFullScreen
599+
allow="clipboard-write">
600+
</iframe>
601+
</div>
602+
<p></p>
589603

590604

591605
### Using JSON Path
592606

593-
While accessing values from an API Call, you can either enter the custom JSON path or use the already created JSON path.
594-
595-
To use the already added JSON path:
607+
While accessing values from an API Call, you can either enter the custom JSON path or use the [predefined JSON path](#adding-json-path).
596608

597-
1. Select your API response.
598-
2. Set the **API response Options** to **JSON Body**.
599-
3. Set the **Available Options** to **JSON Path**.
600-
4. Set the **JSON Path Name** to the one that you created earlier.
609+
To use a predefined JSON Path, first, select your API response. Then, set the **API Response Options** to **JSON Body** and the **Available Options** to **JSON Path** or **Predefined Path**. Finally, specify the JSON Path Name or select from the predefined JSON Path to map the extracted data for use in your app.
601610

602-
<div class="video-container"><iframe src="https://www.loom.
603-
com/embed/502ffe547e64486c937e74c02b28fd3a?sid=21233fb9-9782-4e2f-b04a-a888d784f62f" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe></div>
611+
<div style={{
612+
position: 'relative',
613+
paddingBottom: 'calc(56.67989417989418% + 41px)', // Keeps the aspect ratio and additional padding
614+
height: 0,
615+
width: '100%'}}>
616+
<iframe
617+
src="https://demo.arcade.software/gfbboO0ju21x2LhkksMy?embed&show_copy_link=true"
618+
title=""
619+
style={{
620+
position: 'absolute',
621+
top: 0,
622+
left: 0,
623+
width: '100%',
624+
height: '100%',
625+
colorScheme: 'light'
626+
}}
627+
frameborder="0"
628+
loading="lazy"
629+
webkitAllowFullScreen
630+
mozAllowFullScreen
631+
allowFullScreen
632+
allow="clipboard-write">
633+
</iframe>
634+
</div>
635+
<p></p>
604636

605637

606638
## Advanced Settings
@@ -739,3 +771,23 @@ If you prefer watching a video tutorial, here's the one for you:
739771
<div class="video-container"><iframe src="https://www.youtube.
740772
com/embed/L5qj2f9skt4" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe></div>
741773
:::
774+
775+
776+
## FAQs
777+
<details>
778+
<summary>
779+
Why is my Predefined Path not showing any options?
780+
</summary>
781+
<p>
782+
This often happens if you added the Predefined Path but forgot to save the API call in FlutterFlow. Ensure you click Save after making any changes to your API call so FlutterFlow can properly recognize and display your predefined paths.
783+
</p>
784+
</details>
785+
786+
<details>
787+
<summary>
788+
Why am I getting a “Current variable is not valid” error?
789+
</summary>
790+
<p>
791+
This error typically indicates that the widget isn’t receiving the data type it expects. For example, passing a list of colors directly to a text widget will trigger the error. In such cases, convert or supply the data as a string (or another compatible type) so the widget can properly display it.
792+
</p>
793+
</details>

0 commit comments

Comments
 (0)