web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / how to restrict a text...
Power Apps
Answered

how to restrict a text box or a submit button after more than 10 times in power apps

(0) ShareShare
ReportReport
Posted on by 403

I have a text box called 'question' and a submit button called 'generate answer'

So whenever user types any question, and click generate answer , a answer text box will be displayed below and the answer will be shown

So this process is happening in backend using external API and power automate.

Ok, so whatever question they type, it will be saved in sharepoint list  (under a column field called question)

along with answer also it will be saved in sharepoint list (under a column field called answer)

pls note that :

the question text input is named as TextInput1

and submit button is named as Button1

 

-------------------------------------------------------------------------------------------------------------------------------------

Now my question is,

how can i make the user type question 10 times  only in a day and if the user reaches more than 10 times, the text button and submit button should be disabled. 

how to write logic code for this?

@RusselThomas @WarrenBelz 

------------------------------------------------------------------------------------------------------------------------------------------

pls note: im authenticating user creds in backend using sharepoint list. 

username is saved in a column called 'user'

Categories:
I have the same question (0)
  • Verified answer
    zmansuri Profile Picture
    6,048 Super User 2024 Season 1 on at

    App.OnStart

    Write a filter code that will filter logged in user's record by today's date Something like this:

    Set(varCount,CountRows(Filter(ListName, CreatedBy.Email = User().Email && CreatedDate = Today())));

    The above code will filter the list by logged in user and today's date and store the count of record in a variable name varcount. Note: CreatedBy and CreatedDate are default sharepoint columns.

     

    Then on your button or wherever you want just check if the count is 10.

    For eg.

    Your submit button display mode property:

    If(varCount < 10,Edit,Disabled);

  • Jupyter123 Profile Picture
    403 on at

    hey @zmansuri thanks for the quick response.

    'Created by' - Sharepoint column i can see in 'hidden column section' but i cannot see 'CreatedDate' column

    ---------------------------------------------------------------------------------------------------------------------

    Apart from this, there's a problem

    CreatedBy- shows my name and not the user's name who logged in

    but there is a seperate column called 'user1' which shows the user name who logged in

    so can u modify your code in such a way ?

    i am not really good at coding.

  • zmansuri Profile Picture
    6,048 Super User 2024 Season 1 on at

    a.png

     

    This 2 are the columns. Every sharepoint list have them. If created by column have name of the person who created the entry in powerapps. Are you using any power automate flow?

  • Jupyter123 Profile Picture
    403 on at

    Hi @zmansuri ,
    I use power automate for integrating external API in the backend.

    I use sharepoint list for authenticating username and password.

    Pls note that i created a variable called varUserRecord for saving the username whenever they login.

    Set(varUserRecord, {});

    Set(varUserRecord, LookUp(logindatabase, Title=Usernametxt.Text && Password=Passwordtxt.Text));

    Patch(SPO_LIST, {Title:varUserRecord.Title, question:TextInput1.Text, } );

    So in backend sharepoint list i will be having something like this

    'User'                        'question'

    user123             question they type

    -----------------------------------------------------------

    the data type of the column user is 'single line of text' i think string type.

    so, how the code will be modified as per this requirement?

  • Jupyter123 Profile Picture
    403 on at

    @WarrenBelz and @zmansuri 

    'Createdby' column shows my name and not the user name who has signed in.

    but, im saving the user name in a seperate column called 'user'.

    so whoever has logged in to my application, the user name will be displayed in column field called 'user'

    I use sharepoint list for authenticating username and password.

    Pls note that i created a variable called varUserRecord for saving the username whenever they login.

    Set(varUserRecord, {});

    Set(varUserRecord, LookUp(logindatabase, Title=Usernametxt.Text && Password=Passwordtxt.Text));

    Patch(SPO_LIST, {Title:varUserRecord.Title, question:TextInput1.Text, } );

    So in backend sharepoint list i will be having something like this

    'User'                        'question'

    user123             question they type

    -----------------------------------------------------------

    the data type of the column user is 'single line of text' i think string type.

    so, how the code will be modified as per this requirement?

  • Jupyter123 Profile Picture
    403 on at

    thanks to @zmansuri for solving the issue that i faced.
    he is the best author.
    appreciate his patience and hats off to his teaching!!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 541

#2
WarrenBelz Profile Picture

WarrenBelz 434 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 289

Last 30 days Overall leaderboard