cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
3csman
Impactful Individual
Impactful Individual

Multiple Component Condition

I was hoping this would work. It doesn't see to be. I have an SP library where the file format of image, work, and pdf files are as such:


New Uploads:

2021 CT0000 Ship Captain Charlie Tuna 2_14_2021

 

or 

Inherited Files: (had no date at the end)

2021 CT0000 Ship Captain Charlie Tuna

The first part has always worked. Is there a way to make both work together; if the format doesn't match the first check again against the second, type of thing? Or, can I limit the search to jus the first four fields; regardless of whether the file name has a date in it or not?

Image Control in Gallery:
First(Filter(CQImageCollection, 'Name'=ThisItem.CQYr & " " & ThisItem.UnqID & " " & ThisItem.CQTitle & " " & ThisItem.FrstNm & " " & ThisItem.LstNm & " " & ThisItem.DteofCQ)).'{Link}' & First(Filter(CQImageCollection, 'Name'=ThisItem.CQYr & " " & ThisItem.UnqID & " " & ThisItem.CQTitle & " " & ThisItem.FrstNm & " " & ThisItem.LstNm)).'{Link}'

22 REPLIES 22
3csman
Impactful Individual
Impactful Individual

Changed the SP library Thumbnail setting from 'hyperlink' to 'picture'.

The library column now display the image. However, I am still not getting that image to appear in the Gallery.

 

There is currently now error indicted in the condition.

 

3csman_2-1613347260548.png

 

This, by itself, does still work to return the images with the original naming convention (no date at the end).

 

First(Filter(CQImageCollection, 'Name'=ThisItem.CQYr & " " & ThisItem.UnqID & " " & ThisItem.CQTitle & " " & ThisItem.FrstNm & " " & ThisItem.LstNm)).'{Link}'

These two together ONLY return the original naming format files.

First(Filter(CQImageCollection, 'Name'=ThisItem.CQYr & " " & ThisItem.UnqID & " " & ThisItem.CQTitle & " " & ThisItem.FrstNm & " " & ThisItem.LstNm)).'{Link}' & First(Filter(CQImageCollection, 'Name'=ThisItem.CQYr & " " & ThisItem.UnqID & " " & ThisItem.CQTitle & " " & ThisItem.FrstNm & " " & ThisItem.LstNm & " " & ThisItem.DteofCQ)).'{Link}'

 

The version you've provided hasn't returned any images, yet.

RandyHayes
Super User III
Super User III

@3csman 

I notice a couple of differences in my original.  Change your formula to the following:

With({_common: ThisItem.CQYr & " " & ThisItem.UnqID & " " & ThisItem.CQTitle & " " & ThisItem.FrstNm & " " & ThisItem.LstNm},
    Coalesce(
        LookUp(CQImageCollection, 'Title'= _common & " " & ThisItem.DteofCQ),
        LookUp(CQImageCollection, 'Title' = _common)
    )
).'Thumbnail ({Thumbnail})'.Large

 

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

Really want to show your appreciation? Buy Me A Cup Of Coffee!
3csman
Impactful Individual
Impactful Individual

No error; but no images.

3csman_0-1613348536167.png

 

I changed 'Title' to 'Name' and the original format of images now display (without the DteofCQ). However, nothing with the DteofCQ at the end displays.

3csman_1-1613348695871.png

 

Here is the library, showing one of the new items with the DateofCQ at the end and the image.

3csman_3-1613349038865.png

 

 

3csman
Impactful Individual
Impactful Individual

I really do want to know if one condition will do both tasks; however, in the interest of time I pondered; I could just make to image controls overlayed upon each other, each with a condition. Only one will appear at a time. If both are empty then the 'No Record' image appears. Thoughts?

3csman
Impactful Individual
Impactful Individual

Eh, maybe not. Tried it; no image. Made a copy of the image control and placed the below in it. No image.

 

First(Filter(CQImageCollection, 'Name'=ThisItem.CQYr & " " & ThisItem.UnqID & " " & ThisItem.CQTitle & " " & ThisItem.FrstNm & " " & ThisItem.LstNm & " " & ThisItem.DteofCQ)).'{Link}'

 

Here is the image file in the library. Not sure why the condition is not returning the image.

3csman_0-1613350882936.png

 

If I put this in the the same new image control I get all the originally formatted image files (without the DteofCQ component) without a problem.

 

First(Filter(CQImageCollection, 'Name'=ThisItem.CQYr & " " & ThisItem.UnqID & " " & ThisItem.CQTitle & " " & ThisItem.FrstNm & " " & ThisItem.LstNm)).'{Link}'

 

3csman
Impactful Individual
Impactful Individual

I may have found the culprit. 👀

 

The DteofCQ in a calculated column in the list based on the uploaded CQTitle. The date is at the very end and I haven't figured out the correct Right/MID configuration; hence no date but a piece of the CQTitle.

Do you have a RIGHT/MID condition that will get me that date? I couldn't get it because the file name actually ends with .jpg, so you have to take that into account first, then get the next 10 from the '.'.

 

The CQCollection DateofCQ columns have this in it -

3csman_1-1613351457258.png

 

and the list...

3csman_2-1613351632237.png

 

RandyHayes
Super User III
Super User III

@3csman 

The formula I provided is what you need.  We just need to take into account your scenario then for the date.

I am not sure of the part of that date that you are struggling with.

 

I would say that at least putting the condition of the LookUp to StartsWith will give us a little better results.

So this formula:

With({_common: ThisItem.CQYr & " " & ThisItem.UnqID & " " & ThisItem.CQTitle & " " & ThisItem.FrstNm & " " & ThisItem.LstNm},
    Coalesce(
        LookUp(CQImageCollection, StartsWith('Title', _common & " " & ThisItem.DteofCQ)),
        LookUp(CQImageCollection, StartsWith('Title', _common))
    )
).'Thumbnail ({Thumbnail})'.Large

This will at least return an image. It might not be the right image until we work out the DteofCQ.

 

I thought the DteofCQ was an actual date.  But it seems in your response that it is a file name??

According to your image the DteofCQ needs to be the date in the m_d_yyy format.

What am I missing from the DteofCQ?

 

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

Really want to show your appreciation? Buy Me A Cup Of Coffee!
3csman
Impactful Individual
Impactful Individual

Yep; its in. I just comment in and out the other test conditions. Right now its on your condition and providing the original format images.

Is there a way to add a DteofCQ column to the library, patch the date along with the image, and refer to that column (by way of 'ID' or something) and add that to the condition instead of ThisItem.DteofCQ.

RandyHayes
Super User III
Super User III

@3csman 

Oh absolutely.  You can add another column to your library and store the DteofCQ there.  That can then be added to the lookup condition.

ex.

With({_common: ThisItem.CQYr & " " & ThisItem.UnqID & " " & ThisItem.CQTitle & " " & ThisItem.FrstNm & " " & ThisItem.LstNm},
    Coalesce(
        LookUp(CQImageCollection, StartsWith('Title', _common && DteofCQ=ThisItem.DteofCQ)),
        LookUp(CQImageCollection, StartsWith('Title', _common))
    )
).'Thumbnail ({Thumbnail})'.Large
_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
3csman
Impactful Individual
Impactful Individual

This is everything that is Updating the list or uploading the image file.

 

Where and how in all of this do I add the language to also add/update the DteofCQ column for this record when the item is created in the CertsandQualsLibrary?

3csman_0-1613363135230.png

 

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,899)