cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
tuonoman
Helper IV
Helper IV

add row in function

Hi All

 

I've been going around in circles for quite some time, so I need help.

I need to add a gallery a line number in the function below.

 

I can't do it !

 

Thanks for your help

Search( AddColumns(PRODUCT; 
       "TAG_NAME"; 
        LookUp(TAG;ID_TAG=PRODUCT[@ID_TAG]).TAG_NAME;
       "PROVIDER_NAME"; 
       LookUp(PROVIDER;ID_PROVIDER=PRODUCT[@ID_PROVIDER1]).PROVIDER_NAME
)
    ;
    tdSearchinput.Text;"PRODUCT_NAME";"TAG_NAME";"PROVIDER_NAME"
)

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User III
Super User III

@tuonoman 

Ugh, sorry, I see another typo in my formula.  Feel free to bounce back issues right away so you don't spend too much time trying to figure out my syntax issues - it's always a challenge to type these formulas by hand in the forum without the aid of the formula editor in PowerApps...I guess it has made me lazy!

 

Here is an update:

With({_items:
    Search( 
        AddColumns(PRODUCT As _product; 
           "TAG_NAME"; LookUp(TAG; ID_TAG = _product.ID_TAG; TAG_NAME);
           "PROVIDER_NAME"; LookUp(PROVIDER; ID_PROVIDER=_product.ID_PROVIDER1; PROVIDER_NAME)
        );
       tdSearchinput.Text; "PRODUCT_NAME"; "TAG_NAME"; "PROVIDER_NAME"
    )};
    
    ForAll(Sequence(CountRows(_items));
        Patch(Last(FirstN(_items; Value)); {LineNumber: Value})
    )
)

 

I hope I got them all this time...but if still no joy, respond back as soon as you run into trouble.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

8 REPLIES 8
RandyHayes
Super User III
Super User III

@tuonoman 

Consider the following change to your formula:

With({_items:
    Search( 
        AddColumns(PRODUCT As _product; 
           "TAG_NAME"; LookUp(TAG; ID_TAG = _product.ID_TAG, TAG_NAME);
           "PROVIDER_NAME"; LookUp(PROVIDER; ID_PROVIDER=_product.ID_PROVIDER1, PROVIDER_NAME)
        );
       tdSearchinput.Text; "PRODUCT_NAME"; "TAG_NAME"; "PROVIDER_NAME"
    )},
    
    ForAll(Sequence(CountRows(_items));
        Patch(Last(FirstN(_items), Value)), {LineNumber: Value})
    )
)

 

This will give you a line number column for every record.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!
tuonoman
Helper IV
Helper IV

Hi @RandyHayes 

 

Thank you
It does not seem to be working
There must be a problem with the "," and the full stops ";" or another syntax that is different between France and English-speaking countries.
I know that there is an article about it but I can't find it anymore.

Thanks

RandyHayes
Super User III
Super User III

@tuonoman 

Sorry, I tried to scrub it to change commas into semis, but seemed to miss a couple.

Here is a better version:

With({_items:
    Search( 
        AddColumns(PRODUCT As _product; 
           "TAG_NAME"; LookUp(TAG; ID_TAG = _product.ID_TAG, TAG_NAME);
           "PROVIDER_NAME"; LookUp(PROVIDER; ID_PROVIDER=_product.ID_PROVIDER1, PROVIDER_NAME)
        );
       tdSearchinput.Text; "PRODUCT_NAME"; "TAG_NAME"; "PROVIDER_NAME"
    )};
    
    ForAll(Sequence(CountRows(_items));
        Patch(Last(FirstN(_items); Value)); {LineNumber: Value})
    )
)
_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

@RandyHayes 

 

I have the feeling that the slightest small syntax error poses a problem.
It's still blocking, sorry.
It's normal the " _ " in front of " ITEMS " " product " " _product.ID_PROVIDER1 "

RandyHayes
Super User III
Super User III

@tuonoman 

Yep, missed another one.  If you see any more commas that I am missing, change them to sim-colons.

Here is the latest:

With({_items:
    Search( 
        AddColumns(PRODUCT As _product; 
           "TAG_NAME"; LookUp(TAG; ID_TAG = _product.ID_TAG; TAG_NAME);
           "PROVIDER_NAME"; LookUp(PROVIDER; ID_PROVIDER=_product.ID_PROVIDER1; PROVIDER_NAME)
        );
       tdSearchinput.Text; "PRODUCT_NAME"; "TAG_NAME"; "PROVIDER_NAME"
    )};
    
    ForAll(Sequence(CountRows(_items));
        Patch(Last(FirstN(_items); Value)); {LineNumber: Value})
    )
)
_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

Hi @RandyHayes 

 

Sorry, I spent 2 hours trying to understand, but your proposal doesn't work.

I can't understand why.


I enclose a screenshot

table.JPG

RandyHayes
Super User III
Super User III

@tuonoman 

Ugh, sorry, I see another typo in my formula.  Feel free to bounce back issues right away so you don't spend too much time trying to figure out my syntax issues - it's always a challenge to type these formulas by hand in the forum without the aid of the formula editor in PowerApps...I guess it has made me lazy!

 

Here is an update:

With({_items:
    Search( 
        AddColumns(PRODUCT As _product; 
           "TAG_NAME"; LookUp(TAG; ID_TAG = _product.ID_TAG; TAG_NAME);
           "PROVIDER_NAME"; LookUp(PROVIDER; ID_PROVIDER=_product.ID_PROVIDER1; PROVIDER_NAME)
        );
       tdSearchinput.Text; "PRODUCT_NAME"; "TAG_NAME"; "PROVIDER_NAME"
    )};
    
    ForAll(Sequence(CountRows(_items));
        Patch(Last(FirstN(_items; Value)); {LineNumber: Value})
    )
)

 

I hope I got them all this time...but if still no joy, respond back as soon as you run into trouble.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

tuonoman
Helper IV
Helper IV

@RandyHayes 

cooolllll, that works !!!!

many thanks

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

PA Community Call

Power Apps Community Call

Next call is happening on April 21st at 8a PST.

MBAS Carousel

Sign up for our May 4th event!

May the fourth be with you, join us online!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Top Solution Authors
Top Kudoed Authors
Users online (16,013)