Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

Disabling a button when a record in Sharefile already contains specific value/text

(0) ShareShare
ReportReport
Posted on by

Hello all,

I have a sharepoint list with several columns for multiple input app screens (each screen pushing out text/values to certain columns). I would like to disable a button accessing each 'record screen' in case when there is a record already in any relevant columns - based on a TextInput field value (on a previous screen) and any value already being present in the list from the 'record screen'.

 

Currently playing with the following code:

If(LookUp('Workflow Reminder-Dpt','Workflow Reminder-Dpt'.ProjectNumber=TextInput1.Text,'Workflow Reminder-Dpt'.ProjectNumber),DisplayMode.Disabled,Edit)

 

The code does not work and I still need to add condition for 'any' other record in certain column.

 

Please has anyone been trying to resolve similar issue?

 

Kind Regards,

 

Ajwou

Categories:
  • Ajwou Profile Picture
    Ajwou on at
    Re: Disabling a button when a record in Sharefile already contains specific value/text

    Yes, it worked. Thanks a lot!

  • WarrenBelz Profile Picture
    WarrenBelz 145,445 on at
    Re: Disabling a button when a record in Sharefile already contains specific value/text

    Hi @Ajwou ,

    Just checking if you got the result you were looking for on this thread. Happy to help further if not.

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • Verified answer
    WarrenBelz Profile Picture
    WarrenBelz 145,445 on at
    Re: Disabling a button when a record in Sharefile already contains specific value/text

    Hi @Ajwou ,

    Are you simply looking to see if the project is present? - try this.

    With(
     {
     wDept:
    	 Filter(
     'Workflow Reminder-Dpt',
     ProjectNumber=TextInput1.Text
     )
     },
     If(
     CountRows(wDept)=0
     DisplayMode.Disabled,
     DisplayMode.Edit
     )
    )

    Note the With() statement is only to address Delegation issues.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • Ajwou Profile Picture
    Ajwou on at
    Re: Disabling a button when a record in Sharefile already contains specific value/text

    Hi @VijayTailor ,

    Thank you for your help. I have tried using the suggestion below but it hasn't worked. Maybe I didn't explain the issue correctly. See below the actual screens/steps, if that helps:

    Ajwou_0-1604437802641.png

    At the moment I am doing it for one button but the plan is to do similar exercise for the remaining buttons. All records are stored in one SharePoint list, therefore I would be updating the list for each Project Stage (entered details) always checking if the project number and any record from individual stage is already present. 

     

    Kind Regards, 

     

    Ajwou

     

  • Vijay Tailor Profile Picture
    Vijay Tailor 2,961 on at
    Re: Disabling a button when a record in Sharefile already contains specific value/text

    Hi @Ajwou ,

    For this scenario.  
    OnSelect Property for Button that Navigating you on Another Screen, 
    you can use code like below.
    Set(ValueExist,LookUp('Workflow Reminder-Dpt','Workflow Reminder-Dpt'.ProjectNumber=TextInput1.Text,'Workflow Reminder-Dpt'.ProjectNumber));
    Now You can use this variable for validation purpose for set the Display Mode for the Button on the screen.
    Like below - 
    If(IsBlank(ValueExist),DisplayMode.Edit,DisplayMode.Disabled)

    See the Reference - 

    VijayTailor_1-1604423718219.png

     

    VijayTailor_0-1604423688475.png

     

    Thanks,
    Vijay

    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."-Vijay

     







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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,445

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,741

Leaderboard