# Extract number plate and state from photo of number plate

**URL:** <https://community.glideapps.com/t/extract-number-plate-and-state-from-photo-of-number-plate/73169>\
**Category:** Ask for Help\
**Created:** [May 8, 2024, 2:03am UTC](https://community.glideapps.com/t/extract-number-plate-and-state-from-photo-of-number-plate/73169 "2024-05-08T02:03:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![blairrorani](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/blairrorani/32/43426_2.png) [@blairrorani](https://community.glideapps.com/u/blairrorani)\
**Post date:** [May 8, 2024, 2:03am UTC](https://community.glideapps.com/t/extract-number-plate-and-state-from-photo-of-number-plate/73169/1 "2024-05-08T02:03:22Z")

</div>

**Goal**  
Extract number plate and state from photo of number plate

**Progress**

1. Image to text
2. Split text
3. Turn split text into an array
4. Get first item in array
5. Replace - and .
6. Get plate (if it isn’t a state, because sometimes a state is the first item in the image and therefore the extracted text)
7. Get state (if extracted text includes state)

 ![Screenshot 2024-05-08 at 12.00.30](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/b/6/b6e996440933f3990a5a27669be591c0402061af.png)

 ![Screenshot 2024-05-08 at 12.00.58](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/3/5/35d7c8bc1b16fa7997deff4071dd7571a2928d46.png)

**Help needed**  
If the first text extracted isn’t a number plate, it is usually a state if it isn’t, then how do I get the number plate? Number plates can be in many formats and could be personalised so no real logic. You can see from screenshot example number 4 where first text is NSW not a plate.

---

<div class="post-metadata">

**Author:** ![david](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/david/32/62831_2.png) [@david](https://community.glideapps.com/u/david)\
**Post date:** [May 8, 2024, 2:19am UTC](https://community.glideapps.com/t/extract-number-plate-and-state-from-photo-of-number-plate/73169/2 "2024-05-08T02:19:42Z")

</div>

For this I would try the OpenAI integration’s `Complete chat` column, passing it a URL to the image, and asking for the state and number directly in one go. Use the `gpt-4-turbo` model.
