# Connect increment value to specific user

**URL:** <https://community.glideapps.com/t/connect-increment-value-to-specific-user/68590>\
**Category:** Ask for Help\
**Created:** [December 12, 2023, 6:58am UTC](https://community.glideapps.com/t/connect-increment-value-to-specific-user/68590 "2023-12-12T06:58:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ckinross](https://avatars.discourse-cdn.com/v4/letter/c/3ab097/32.png) [@ckinross](https://community.glideapps.com/u/ckinross)\
**Post date:** [December 12, 2023, 6:58am UTC](https://community.glideapps.com/t/connect-increment-value-to-specific-user/68590/1 "2023-12-12T06:58:06Z")

</div>

I think my current setup is close…but not quite right.  
Use case description:

- the ‘generate image’ command from the OpenAi integration creates an image based on a prompt. ✅This works.

- In order to cap the amount of money that will be spent from using OpenAi, each user can generate up to 3 images per day. Every time they generate an image, a value increments. ✅ This works

- [This part doesn’t work] Data for the prompt is stored in ‘Sheet B.’ Data for the increment number is also stored in ‘Sheet B.’ User profile info is stored in the ‘Users’ sheet. I tried using the array feature to pull in the row ID and email from ‘Users’ into ‘Sheet B’ so that I can cap each user at the same number of images generated. When I view the app as different profiles, I see the array info change but the user-generated image content does not change.  

I am not correctly tying ‘Sheet B’ to ‘Users’ in order to calculate a per-user cap on image generation.  
May I ask for help to identify where I went astray?  
Thanks

---

<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:** [December 12, 2023, 9:02am UTC](https://community.glideapps.com/t/connect-increment-value-to-specific-user/68590/2 "2023-12-12T09:02:32Z")

</div>

I’m not quite sure that I follow your logic, but here is how I would do this:

- Ensure that you are saving both the users email address and date generated in the table where your images are stored.
- In your User Profile table, create a Query column that targets your Image table, and apply the following filters:  
– Email address is This row-\>Email  
– Date is within Today
- Add a Rollup-\>Count via the Query column
- If the count is equal to 3, don’t allow an image to be generated (I would use the count as a visibility condition)
