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 / If isBlank function ne...
Power Apps
Answered

If isBlank function need help

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello everyone,

 

I request your help to solve one question on If IsBkank function.

 

  • I have a gallery (gallery1) and a form (form1) with gallery1.Selected in Items.
  • I have an excel table (Table1 with multiple columns. One of them is called: Example and accept only integers).
  • Inside my DataCard Defaut section:

If( IsBlank(Example); "1"; ThisItem.Example)

   

-> Read 1 in DataCard if is blank or the value of the seleted gallery if there is one.

 

Ok but it's what I'm looking for: DONT WORKS

 

If( IsBlank(Example); DataSourceInfo( Table1, DataSourceInfo.MaxValue, "Example" ) + 1 ; ThisItem.Example)

 

 

-> I'm trying to read the value of Example selected if there is one or to read and add 1 to the maxvalue of Example 

 

Example=[0,1,2,3,4,5,6,7]    

I select in my gallery the Example number 7

It shows in my Form1 DataCard the number 7

If I create a new example

New Form1 opened with Datacard with the value 8    Maxval(example)+1 =7+1=8

Example=[0,1,2,3,4,5,6,7,8]

 

Do you have an idea ? 

 

Best Regards,

 

Thomas

Categories:
I have the same question (0)
  • Brian Dang Profile Picture
    3,976 on at

    It might be because you are using semi-colons instead of commas:

    If( IsBlank(Example); "1"; ThisItem.Example)
    
    vs.
    
    If( IsBlank(Example), "1", ThisItem.Example)

    Try changing it to commas inside the formula. Semi-colons are used for separating multiple formulas/actions so they are in between or outside and not inside.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hello Mr Dang and Thanks to you. My  description was really bad. I was looking for an automatic incrementation if one Data card from gallery was empty.

     

    For example I have one ID column in my tablel [ID=1,2,3,4,5]

    When I select a line from my gallery it navigate to an ViewerForm page.

    If the ID is refered, DataCard of my ViewerForm shows me the ID of the selected line. (for example the ID of the line selected is 5)

     

    If I select my button to create a new entry, then I navigate to my NewForm page and  the ID data card is already filled with the number 6.

     

    I find the way to do it with this function :

     

    Items:   If(IsBlank(Mytable.ID); CountRows(Mytable) + 1; ThisItem.ID)

     

    = If my ID card is Blank, count the number of rows ( here there are 5 rows) and add 1, else if ID already exist just show it.

    = I select the ID 5, the data card show me 5

    = I select new form, no existing ID, count rows = 5 and add 1, 5+1 = 6 

     

    I hope this could help others

  • Verified answer
    Meneghino Profile Picture
    6,949 on at

    Hi both.

    @mr-dang please note that for some locales (e.g. Europe) "," is replaced by a ";" and ";" by ";;"  I never thought this was a good idea, but obviously MS do not agree.

     

    @Anonymous  I think your original problem is that you used the DataSourceInfo function, but this is not the correct function since it returns the maximum POSSIBLE value of a field, not its current maximum value.  To do this, use instead

    If( IsBlank(Example); Max( Table1; "Example" ) + 1 ; ThisItem.Example)
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @Meneghino Thank you very much!  I used your answer as the solution I was looking for.

     

     

    Best Regards,

     

    Thomas

  • shal2522 Profile Picture
    76 on at

    I have a dropdown list of users which I am getting from office 365.

    When a user is selected I need it to be displayed in the gallery.

    This is the code I am using but I get an error that says that there are Invalid arguments

    Combobox1 is the dropdownlist.

    In the field where I need the selected user name populated I am using this code in Text : If(IsBlank(Combobox1.DisplayName),"Unassigned",Combobox1.DisplayName)

     

    How do I resolve this?

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 463

#2
WarrenBelz Profile Picture

WarrenBelz 364 Most Valuable Professional

#3
11manish Profile Picture

11manish 275

Last 30 days Overall leaderboard