cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Image Based on Multiple Condition File Name

I have an Image field in a Gallery. The image is in a separate SP library for which I have created a Collection that runs on start.

 

I need the Image field to display the specific certification or qualification based on the content of the file name in the library.

 

The file names are formatted as such:      AA0000_2008_FirstName__LastName_Driver

 

Is it possible to edit the following so that it forces the exact image based all or any part of the files name. If only part - the UnqID, Year, CQTitle (all columns on the Member list).

 

First(Filter(DocumentsCollection,Name=ThisItem.     )).'Link to item'

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @Anonymous ,

Since we use ThisItem.Title to retain the Title column value from gallery, I just want to confirm if these column(Title, CQYr, FrstNm, LstNm, CQTitle)  belong to Member Training list, the Items of Gallery?  If the Concatenate still doesn't work, please change to use & operator to concatenate all text.

 

In addition, I suggest use Thumbnail to retrieve the image since it supports both PDF files and image files. Please try this:

 

LookUp(CertsQualsDocumentsCollection,
Name= ThisItem.Title&"_" &ThisItem.CQYr&"_" &ThisItem.FrstNm&"_" &ThisItem.LstNm&"_" &ThisItem.CQTitle ||
Name= ThisItem.Title&"_" &ThisItem.CQYr&"_" &ThisItem.CQTitle).Thumbnail.Large

 

Hope this helps.

Sik

View solution in original post

11 REPLIES 11
v-siky-msft
Community Support
Community Support

Hi @Anonymous ,

 

Could you please share more details about your scenario? What is the items of the Gallery? Is the Gallery bound to the Member list?

Is the file name composed by all column value from gallery Items(Member List)?

Does the following codes make sense for your case?

LookUp(
DocumentsCollection,
Name= Concatenate(ThisItem.UnqID,"_" ,ThisItem.Year,"_", ThisItem.FirstName,"_" ,ThisItem.LastName,"_", ThisItem.CQTitle)  // all conditions
||
(StartsWith(Name, Concatenate(ThisItem.UnqID,"_" ,ThisItem.Year,"_") && ThisItem.CQTitle in Name)  // part conditions
).'Link to item'

 Hope this helps.

Sik

Anonymous
Not applicable

Could you please share more details about your scenario? What is the items of the Gallery?

     Items property of Gallery where Image field was 'installed' is:

             Filter(CQCollection, FullNm = MmbrFullNmDD.SelectedText.FullNm)

     The Gallery is pulling from the list that includes columns for UnqID, CQYr, FrstNm, LstNm, and CQTitle.

 

Is the Gallery bound to the Member list? 

     The Dropdown that trigger the Gallery is bound to the Member list.
     The Gallery is bound to the Member Training List.
     The Image is in the Member Cert Qual List.

 

Is the file name composed by all column value from gallery Items(Member List)?

      The Image files in the Library are all imports from another environment. The files names appear in two ways:

             UnqID_CQYr_Jane_Doe_CQTitle.(whatever file type)

                    AA0000_2020_FirstNm_LastNm_Driver_II.pdf    

 

                    AA0000_2008_FirstNameLastName_DriverII.jpg

 

Does the following codes make sense for your case?

 

I tried the below and go the following error: The function 'Concatenate' has some invalid arguments.

                                                                        The function 'StartsWith' has some invalid arguments.

 

LookUp(CQDocumentsCollection, Name= Concatenate(ThisItem.UnqID,"_" ,ThisItem.CQYr,"_" ,ThisItem.FrstNm,"_" ,ThisItem.LstNm,"_" ,ThisItem.CQTitle) || (StartsWith(Name, Concatenate(ThisItem.UnqID,"_" ,ThisItem.CQYr,"_") && ThisItem.CQTitle in Name),'Link to item' (<when I used .'Link to item' it errored: Improper use of '.' but it took a comma.

 

Starting a new system. If it is more prudent to rename the files. That may be an option; however, should that really matter?

 

It is my plan to have any new documents created/uploaded through the new Power Apps form to have file names forced by the system to look as: UnqID-CQYr-CQTitle.

 

Can you help me with that, too?!

 

I have a flow that uploads the files already working. I need to change the 'Create File Name' parameter in the flow through the expression writer to a concatenate function that grabs the Member's UnqID-CQYr-CQTitle from the Power Apps Upload (through a trigger in the flow) form and apply it to the file name of the document also being uploaded to the SP document library by the flow.

 

 

Anonymous
Not applicable

Also, I changed the name of several of the test files for one of the Members to different potential variations of the file name nomenclature, including to UnqID.

 

In this case we'll assume the Member's UnqID is AA0000. I changed one of the files names in the library to AA000 and entered the below into the Image property. This should have returned the CertQual file for the Member titled 'AA0000'. It did not. There is no error in the formula, yet still no imag.

 

First(Filter(DocumentsCollection,Name=ThisItem.UnqID)).'Link to item'

 

I use this in a similar screen to pull an image of the site, and it works fine.

     First(Filter(SiteImgCollection,'{Name}'=ThisItem.Site)).'{Link}'

Hi  @Anonymous ,

 

If the image file names are formatted as 'UnqID_CQYr_Jane_Doe_CQTitle' , Please try with the following code to Image inside gallery

LookUp(CQDocumentsCollection,
Name= Concatenate(ThisItem.UnqID,"_" ,ThisItem.CQYr,"_" ,ThisItem.FrstNm,"_" ,ThisItem.LstNm,"_" ,ThisItem.CQTitle) ||
Name= Concatenate(ThisItem.UnqID,"_" ,ThisItem.CQYr,"_",ThisItem.CQTitle)
).'Link to item'

 

For your second question, if want to pass the concatenated file name to flow, just also use Concatenate() function to compose the file name with the Member's UnqID-CQYr-CQTitle column value.

 

For your third question, since the UnqID is 'AA0000',and file name is 'AA000', they aren't the same. so the logic should be that the file name is contained in UnqID, or the file name is the same five characters to the left of the ID.

 

First(Filter(DocumentsCollection,StartsWith(Name, ThisItem.UnqID))).'Link to item'

Or

First(Filter(DocumentsCollection, Left(Name,5) = ThisItem.UnqID)).'Link to item'

 

Hope this helps.

Sik

Anonymous
Not applicable

I placed the following in the Image property:

 

LookUp(DocumentsCollection,Name= Concatenate(ThisItem.UnqID,"_" ,ThisItem.CQYr,"_" ,ThisItem.FrstNm,"_" ,ThisItem.LstNm,"_" ,ThisItem.CQTitle) || Name= Concatenate(ThisItem.UnqID,"_" ,ThisItem.CQYr,"_",ThisItem.CQTitle) ).'Link to item'

 

It kicked back the following error:

1. The function Concatenate has some invalid arguments (for both the segments)

2. Type Error: Concatenate: expects either Text or a table column of Text type

 

For question 2; I'm having issue with the concatenate configuration in the flow. Is it triggerBody()...(blah, blah)? I've tried a hundred different ways can't get any to take. Though I know I did get it to work at one time. I'd like the concatenate formulate to name the file UnqID-CQYr-CQTitle.

 

For question 3: the UnqID are identical on all list/collections. My question had a typo. All UnqIDs are formatted the same (1st initial 1st Frst Name, 1st initial Lst Name, Last Four).

 

Hi @Anonymous ,

 

 

I can find any formula syntax error. Could you please share some screenshots on your app to elaborate the issue?

Sik

Anonymous
Not applicable

Not sure what to tell you. I placed the following in the Image properties and got the same error(s).

     -'Title' is the actual name of the column holding the UnqID in the SP list/collection

    - Error Message: "The function 'Concatenate' has some invalid arguments."

 

LookUp(CertsQualsDocumentsCollection,
Name= Concatenate(ThisItem.Title,"_" ,ThisItem.CQYr,"_" ,ThisItem.FrstNm,"_" ,ThisItem.LstNm,"_" ,ThisItem.CQTitle) ||
Name= Concatenate(ThisItem.Title,"_" ,ThisItem.CQYr,"_" ,ThisItem.CQTitle)
).'Link to item'

 

The dropdown is connected to a Member list(collection). The Gallery is connected to a Member Training list(collection). The Image needs to pull .pdf files from an SP document library, based on the formula above.

 

There are several files in the folder named in several configurations. Below is my test Member account. I have at least nine Certs and Quals in the SP library. One of those files should appear in the Gallery as I scroll though. None do.

3csman_0-1599499948450.png

 

Anonymous
Not applicable

Also, to be clear these are .pdf files I am talking about trying to pull into and Image field in the Gallery.

 

Is THAT even possible? Or, should I be using another process to retrieve these documents?

Hi @Anonymous ,

Since we use ThisItem.Title to retain the Title column value from gallery, I just want to confirm if these column(Title, CQYr, FrstNm, LstNm, CQTitle)  belong to Member Training list, the Items of Gallery?  If the Concatenate still doesn't work, please change to use & operator to concatenate all text.

 

In addition, I suggest use Thumbnail to retrieve the image since it supports both PDF files and image files. Please try this:

 

LookUp(CertsQualsDocumentsCollection,
Name= ThisItem.Title&"_" &ThisItem.CQYr&"_" &ThisItem.FrstNm&"_" &ThisItem.LstNm&"_" &ThisItem.CQTitle ||
Name= ThisItem.Title&"_" &ThisItem.CQYr&"_" &ThisItem.CQTitle).Thumbnail.Large

 

Hope this helps.

Sik

Helpful resources

Announcements

Community will be READ ONLY July 16th, 5p PDT -July 22nd

Dear Community Members,   We'd like to let you know of an upcoming change to the community platform: starting July 16th, the platform will transition to a READ ONLY mode until July 22nd.   During this period, members will not be able to Kudo, Comment, or Reply to any posts.   On July 22nd, please be on the lookout for a message sent to the email address registered on your community profile. This email is crucial as it will contain your unique code and link to register for the new platform encompassing all of the communities.   What to Expect in the New Community: A more unified experience where all products, including Power Apps, Power Automate, Copilot Studio, and Power Pages, will be accessible from one community.Community Blogs that you can syndicate and link to for automatic updates. We appreciate your understanding and cooperation during this transition. Stay tuned for the exciting new features and a seamless community experience ahead!

Summer of Solutions | Week 4 Results | Winners will be posted on July 24th

We are excited to announce the Summer of Solutions Challenge!   This challenge is kicking off on Monday, June 17th and will run for (4) weeks.  The challenge is open to all Power Platform (Power Apps, Power Automate, Copilot Studio & Power Pages) community members. We invite you to participate in a quest to provide solutions in the Forums to as many questions as you can. Answers can be provided in all the communities.    Entry Period: This Challenge will consist of four weekly Entry Periods as follows (each an “Entry Period”)   - 12:00 a.m. PT on June 17, 2024 – 11:59 p.m. PT on June 23, 2024 - 12:00 a.m. PT on June 24, 2024 – 11:59 p.m. PT on June 30, 2024 - 12:00 a.m. PT on July 1, 2024 – 11:59 p.m. PT on July 7, 2024 - 12:00 a.m. PT on July 8, 2024 – 11:59 p.m. PT on July 14, 2024   Entries will be eligible for the Entry Period in which they are received and will not carryover to subsequent weekly entry periods.  You must enter into each weekly Entry Period separately.   How to Enter: We invite you to participate in a quest to provide "Accepted Solutions" to as many questions as you can. Answers can be provided in all the communities. Users must provide a solution which can be an “Accepted Solution” in the Forums in all of the communities and there are no limits to the number of “Accepted Solutions” that a member can provide for entries in this challenge, but each entry must be substantially unique and different.    Winner Selection and Prizes: At the end of each week, we will list the top ten (10) Community users which will consist of: 5 Community Members & 5 Super Users and they will advance to the final drawing. We will post each week in the News & Announcements the top 10 Solution providers.  At the end of the challenge, we will add all of the top 10 weekly names and enter them into a random drawing.  Then we will randomly select ten (10) winners (5 Community Members & 5 Super Users) from among all eligible entrants received across all weekly Entry Periods to receive the prize listed below. If a winner declines, we will draw again at random for the next winner.  A user will only be able to win once overall. If they are drawn multiple times, another user will be drawn at random.  Individuals will be contacted before the announcement with the opportunity to claim or deny the prize.  Once all of the winners have been notified, we will post in the News & Announcements of each community with the list of winners.   Each winner will receive one (1) Pass to the Power Platform Conference in Las Vegas, Sep. 18-20, 2024 ($1800 value). NOTE: Prize is for conference attendance only and any other costs such as airfare, lodging, transportation, and food are the sole responsibility of the winner. Tickets are not transferable to any other party or to next year’s event.   ** PLEASE SEE THE ATTACHED RULES for this CHALLENGE**   Week 1 Results: Congratulations to the Week 1 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Community MembersNumber of SolutionsSuper UsersNumber of Solutions @anandm08  23 @WarrenBelz  31 @DBO_DV  10 @Amik  19 AmínAA 6 @mmbr1606  12 @rzuber  4 @happyume  7 @Giraldoj  3@ANB 6 (tie)   @SpongYe  6 (tie)     Week 2 Results: Congratulations to the Week 2 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Community MembersSolutionsSuper UsersSolutions @anandm08  10@WarrenBelz 25 @DBO_DV  6@mmbr1606 14 @AmínAA 4 @Amik  12 @royg  3 @ANB  10 @AllanDeCastro  2 @SunilPashikanti  5 @Michaelfp  2 @FLMike  5 @eduardo_izzo  2   Meekou 2   @rzuber  2   @Velegandla  2     @PowerPlatform-P  2   @Micaiah  2     Week 3 Results: Congratulations to the Week 3 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge.   Week 3:Community MembersSolutionsSuper UsersSolutionsPower Apps anandm0861WarrenBelz86DBO_DV25Amik66Michaelfp13mmbr160647Giraldoj13FLMike31AmínAA13SpongYe27     Week 4 Results: Congratulations to the Week 4 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge.   Week 4:Community MembersSolutionsSuper UsersSolutionsPower Apps DBO-DV21WarranBelz26Giraldoj7mmbr160618Muzammmil_0695067Amik14samfawzi_acml6FLMike12tzuber6ANB8   SunilPashikanti8

Check Out | 2024 Release Wave 2 Plans for Microsoft Dynamics 365 and Microsoft Power Platform

On July 16, 2024, we published the 2024 release wave 2 plans for Microsoft Dynamics 365 and Microsoft Power Platform. These plans are a compilation of the new capabilities planned to be released between October 2024 to March 2025. This release introduces a wealth of new features designed to enhance customer understanding and improve overall user experience, showcasing our dedication to driving digital transformation for our customers and partners.    The upcoming wave is centered around utilizing advanced AI and Microsoft Copilot technologies to enhance user productivity and streamline operations across diverse business applications. These enhancements include intelligent automation, AI-powered insights, and immersive user experiences that are designed to break down barriers between data, insights, and individuals. Watch a summary of the release highlights.    Discover the latest features that empower organizations to operate more efficiently and adaptively. From AI-driven sales insights and customer service enhancements to predictive analytics in supply chain management and autonomous financial processes, the new capabilities enable businesses to proactively address challenges and capitalize on opportunities.    

Updates to Transitions in the Power Platform Communities

We're embarking on a journey to enhance your experience by transitioning to a new community platform. Our team has been diligently working to create a fresh community site, leveraging the very Dynamics 365 and Power Platform tools our community advocates for.  We started this journey with transitioning Copilot Studio forums and blogs in June. The move marks the beginning of a new chapter, and we're eager for you to be a part of it. The rest of the Power Platform product sites will be moving over this summer.   Stay tuned for more updates as we get closer to the launch. We can't wait to welcome you to our new community space, designed with you in mind. Let's connect, learn, and grow together.   Here's to new beginnings and endless possibilities!   If you have any questions, observations or concerns throughout this process please go to https://aka.ms/PPCommSupport.   To stay up to date on the latest details of this migration and other important Community updates subscribe to our News and Announcements forums: Copilot Studio, Power Apps, Power Automate, Power Pages

Users online (899)