# Assign AI extracted text to fields

**URL:** <https://community.glideapps.com/t/assign-ai-extracted-text-to-fields/82284>\
**Category:** Ask for Help\
**Created:** [June 6, 2025, 1:24pm UTC](https://community.glideapps.com/t/assign-ai-extracted-text-to-fields/82284 "2025-06-06T13:24:55Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Robert\_Benacka](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/robert_benacka/32/86307_2.png) [@Robert\_Benacka](https://community.glideapps.com/u/Robert_Benacka)\
**Post date:** [June 6, 2025, 1:24pm UTC](https://community.glideapps.com/t/assign-ai-extracted-text-to-fields/82284/1 "2025-06-06T13:24:55Z")

</div>

AI is giving me this result:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/6/c/6ca5405f839b353e462b64594cd37478a298f681.png)  
Can anyone Please point me to a document or video describing how to assign these to respective fields ? Thx

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [June 6, 2025, 2:24pm UTC](https://community.glideapps.com/t/assign-ai-extracted-text-to-fields/82284/2 "2025-06-06T14:24:59Z")

</div>

I would:

- Ask the AI to return data in a JSON format, with an example of JSON structure.
- Use JSON query to query out each of the fields (Date, Title, Text, Category).
- Use those queried fields for stuff you need.

---

<div class="post-metadata">

**Author:** ![Robert\_Benacka](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/robert_benacka/32/86307_2.png) [@Robert\_Benacka](https://community.glideapps.com/u/Robert_Benacka)\
**Post date:** [June 6, 2025, 3:29pm UTC](https://community.glideapps.com/t/assign-ai-extracted-text-to-fields/82284/3 "2025-06-06T15:29:18Z")

</div>

Yes great, thanks, now the AI field does a JSON extract however in some not in all instances the query failed:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/0/e/0e02f5b9d2a52a16f7bd524420519efea4385299.png)  
And I am getting random good and bad query results:  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/a/2/a2a7a3e51cdb2d4502eabb9ddb3d021c33691e66.png)

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [June 6, 2025, 5:36pm UTC](https://community.glideapps.com/t/assign-ai-extracted-text-to-fields/82284/4 "2025-06-06T17:36:42Z")

</div>

For starters, I would instruct the AI to not include the word JSON in front of the curly bracket. Second, I would make sure it’s not including those back ticks at the beginning and end.

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [June 6, 2025, 10:56pm UTC](https://community.glideapps.com/t/assign-ai-extracted-text-to-fields/82284/5 "2025-06-06T22:56:36Z")

</div>

Like Jeff said, add something like this:

"Strictly adhere to returning only a valid JSON, and don’t include backticks or the word JSON itself.

Invalid response:

> ‎```json  
> {  
> “key1”: “value1”,  
> “key2”: “value2”  
> }
> 
> ```auto
> 
> ```

Valid response:

{  
“key1”: “value1”,  
“key2”: “value2”  
}  
"

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [June 7, 2025, 6:07am UTC](https://community.glideapps.com/t/assign-ai-extracted-text-to-fields/82284/6 "2025-06-07T06:07:17Z")

</div>

> [@Robert\_Benacka](#):
>
> Yes great, thanks, now the AI field does a JSON extract however in some not in all instances the query failed:
> 
> ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/0/e/0e02f5b9d2a52a16f7bd524420519efea4385299.png)
> 
> And I am getting random good and bad query results:

Which AI column are you using?  
Use `Text to JSON`. It should always return valid JSON without any special prompting.

---

<div class="post-metadata">

**Author:** ![Robert\_Benacka](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/robert_benacka/32/86307_2.png) [@Robert\_Benacka](https://community.glideapps.com/u/Robert_Benacka)\
**Post date:** [June 7, 2025, 12:16pm UTC](https://community.glideapps.com/t/assign-ai-extracted-text-to-fields/82284/7 "2025-06-07T12:16:08Z")

</div>

Fantastic, Thanks have applied this:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/f/7/f71e024900edc7422f2099462106b42bb996826d.png)  
For some reason the results are not alway the same, I getting some that look likes this:  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/f/d/fdc54975bded97225f207038680f0aa3a5a02479.png)  
and many that would look like this..  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/e/4/e4c873e6c971f19e4cf7f815fb423500b4eb3abb.png)  
Is there a reason for this?

---

<div class="post-metadata">

**Author:** ![Robert\_Benacka](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/robert_benacka/32/86307_2.png) [@Robert\_Benacka](https://community.glideapps.com/u/Robert_Benacka)\
**Post date:** [June 7, 2025, 12:17pm UTC](https://community.glideapps.com/t/assign-ai-extracted-text-to-fields/82284/8 "2025-06-07T12:17:55Z")

</div>

![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/4/7/4721e4cf5243f9b13f00609465cf056bc12b0420.png)

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [June 7, 2025, 1:03pm UTC](https://community.glideapps.com/t/assign-ai-extracted-text-to-fields/82284/9 "2025-06-07T13:03:13Z")

</div>

Give an example in the instructions:

{  
“title”: “Title value”,  
“date”: “Date value”,  
“category”: “Category value”,  
“text”: “Text value”  
}

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/system/32/53398_2.png) [@system](https://community.glideapps.com/u/system)\
**Post date:** [June 14, 2025, 1:03pm UTC](https://community.glideapps.com/t/assign-ai-extracted-text-to-fields/82284/10 "2025-06-14T13:03:23Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
