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 / Validation in gallery ...
Power Apps
Answered

Validation in gallery Control in canvas App

(0) ShareShare
ReportReport
Posted on by 270

1) I have a gallery , by default I am not able to see the first row, I have to click "+" to see first row. How can I make it visisble on the load of the page ?

 

JayashreeKrish_0-1629309689514.png

I have to click "+" for this to appear 

JayashreeKrish_1-1629309722537.png

 

2) The code in my Save &Close button is 

Once I click , the values are stored in a string and sent to another screen,

 

Set(AllPrincipalString,Concat(Gallery1.AllItems,Concatenate(TextInput1.Text,"; ",TextInput2.Text,"; ",TextInput3.Text,"; ",TextInput4.Text,"; ",TextInput5.Text,"; ",TextInput6.Text,"; ",TextInput7.Text,"; ",TextInput8.Text,"; ",TextInput9.Text," | ")));

Notify("Principal Added successfully!",NotificationType.Success);

Navigate(Screen1,ScreenTransition.Cover);

 

But I want the user to user to prevent from submitting if my TextInput1.Text, is empty how can i do that ?

 

 

 

 

Categories:
I have the same question (0)
  • JayashreeKrish Profile Picture
    270 on at

    I tried with 

    ForAll(Gallery1.AllItems,If(Not(IsBlank(TextInput1.Text)),Edit,Disabled))

    in DisplayMode of Button

    But it shows - Enum expected

  • rubin_boer Profile Picture
    4,843 Super User 2024 Season 1 on at

    Hi @JayashreeKrish when you create the collection for the gallery, add blanks to it. By default, your gallery is empty and i assume you user collect to add the rows. 

     

    This will add a row with blank for two items

    ClearCollect(colMyInput,{p_name:Blank(), p_title:Blank()})

    add that to the OnVisible property of the screen. you will get this when the screen opens

    rubin_boer_0-1629313145269.png

    Now for the second part. you are using a gallery, is the plan to have more than one entry? once i know this i will suggest a way forward. your variable collecting the string that way from the gallery is a bit troublesome, id like to get more into that.

     

    hope this helps you

  • JayashreeKrish Profile Picture
    270 on at

    Thanks much @rubin_boer 

    My Question 1 is answered

     

  • Verified answer
    rubin_boer Profile Picture
    4,843 Super User 2024 Season 1 on at

    @JayashreeKrish may i suggest you set the displaymode of the button based on your rule.

     

    Select the display button and set its display mode to

    If(
     CountRows(
     Filter(
     YourGallery.AllItems,
     IsBlank(yourTextBox)
     )
     ) > 0,
     DisplayMode.Disabled,
     DisplayMode.Edit
    )

     

    now when its empty the user will get a disabled button

    rubin_boer_0-1629315876098.png

    and once there is data it will be active

    rubin_boer_1-1629315902164.png

     

    hope thi shelps

  • JayashreeKrish Profile Picture
    270 on at

    For my Question 2,

     

    Once my gallery is loaded,

    If I add value in Principal Name field , I should be able to save all the Principal Names in  a field in Screen 1 separated by semicolon 

     

    If it is empty I should  I should  not be able to save anything in   a field in Screen 1 , it should be blank as it is 

  • JayashreeKrish Profile Picture
    270 on at

    Thanks much @rubin_boer  

    Both my questions are answered 🙂

  • rubin_boer Profile Picture
    4,843 Super User 2024 Season 1 on at

    @JayashreeKrish you may want to investigate to save the collection itself and then patch your datasource with the collection. a good place will be the "+" icon. have a look at this whihc is a very good piece by @mdevaney PATCH Multiple Records In Power Apps 10x Faster - Matthew Devaney

  • JayashreeKrish Profile Picture
    270 on at

    Hi @rubin_boer  

     

    For my first question.

    I have a canvas app with two screen

    On screen 1, if i click on a button it will go to screen 2 which is having gallery

    In screen 2  i have a gallery , with clear , save&close , close button.

     

     

    on load of screen it should show the first entry if it is blank  (it is showing since i put the below code)

    JayashreeKrish_0-1629465992651.png

     

    But  if I  had entered some value ,

    when i come to screen 2 from screen 1 , it should show the value  

    JayashreeKrish_1-1629466038015.png

    But it is not shown as expected when i use the below code

    If I use   the below it is always blank - ClearCollect(colMyInput,{p_name:Blank(), p_title:Blank()})

    How do I avoid that ?

  • anupp Profile Picture
    2 on at

    is it possible to do validation for item level in gallery.

  • rubin_boer Profile Picture
    4,843 Super User 2024 Season 1 on at

    Hi there, may I suggest you open another topic you will be helped quicker this way.

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 534

#2
WarrenBelz Profile Picture

WarrenBelz 416 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 306

Last 30 days Overall leaderboard