PowerApps compare Table values to Text - sharepoint

I have a collection with job titles and question id's called colFunctions. I want to compare the job titles in the collection to a single known job title (a text value) and return a list of question id's.
So for the function Jr. System Administrator I want to get a list with ID's of Q01 and Q03, but not Q02.
I have this so far, but it says I can't compare a table to a text value. How can I overcome this?
ClearCollect(
colMatchedFunction,
Filter(colFunctions,Function = Office365Users.UserProfileV2(galleryDirectReports.Selected.userPrincipalName).jobTitle).QuestionID
);

If Function is a text column in SharePoint, or a multi-select choice column? If it is a text column, you can use the in operator, which can check if a the text contains the given id:
ClearCollect(
colMatchedFunction,
Filter(
colFunctions,
Office365Users.UserProfileV2(galleryDirectReports.Selected.userPrincipalName).jobTitle).QuestionID in Function
));
In a multi-select choice column, you can still use the in operator, this time to check if a value belongs to a table, checking it against the 'Value' property of the multi-select column (which returns the text value represented by the choice):
ClearCollect(
colMatchedFunction,
Filter(
colFunctions,
Office365Users.UserProfileV2(galleryDirectReports.Selected.UserPrincipalName).jobTitle
in Function.Value
));

Related

Is there a vbo to get value from a collection based on value of other fields and save it as a data item?

Relatively new to Blue Prism,
I have a collection that looks like this, with 100+ rows:
Results
Answer
Timestamp
8 Apr 2021
Name
ABC
I'd like to manipulate the data such that if Results = 'Name', Get the Answer (aka ABC) and put it into a data item.
Is there any way to do this?
I understand I could hardcode i.e. Get value based on Row Index and Column Index, but my data is complex and may not always have the same rox index.
Can you use the collection filter to get a collection output? The utility has an action to filter where you can input a collection and then use
[FieldName] Like "some value"
This would result in every complete row in the collection that matches the filter.

Concur / Cognos report studio - Show all items in column a if at least one value in culmn b meets condition

i am currently trying to filter a report containing business trips and itineraries so it shows only those that have at least one business stop abroad.
In more general terms, i want to show all data for a specific value in column "Itinerary Key" if in one of two other columns "Departure Country" OR "Arrival Country" a certain condition ("<> Country") for the information connected to the value in column "Itinerary Key" is met.
So far i created a Query Calculation item ("[Itin Key if Trip abroad]") containing the expression:
CASE WHEN
([Departure Country]<>[Country]) OR ([Arrival Country]<>[Country])
THEN [Itinerary Key]
ELSE Null
END
So i have a column that contains the Itinerary key, but only in the lines where the condition is actually met.
I then created a filter with the following expression:
[Itinerary Key] in ([Itin Key if Trip abroad])
The idea here was to have a selection based on matching the itinerary key with the pool of itinerary keys that meet the condition on any line. However, it still only shows the lines where the Query calculation item actually generates a value.
I want to show all the lines for the columns "Departure Country" and "Arrival Country" for each Itinerary Key where the condition from the query calculation is true at least once.
How can this be done?
I think you can accomplish by using this filter instead of the one you mentioned:
count([Itin Key if Trip abroad] for [Itenerary]) > 0
For every unique itenerary key we will count the non-null values (nulls are ignored in counts). If a specific itenerary has no rows that match the criterion, the count will return 0 and its rows will be excluded. If a specific itenerary has one or more rows that match the criterion, its count will be 1 or more and all rows for that itenerary will be included.

POWEI BI | CASE WHEN / If condition for text string classification

I would like to create a calculated dimension. How it should works is extract data from a column based on different condition, i was looking at the formulation in equivalent to the following:
In SQL:
CASE WHEN REGEXP_MATCH(Data Field A,"((?i).*PMP).*")
THEN "PMP Deal"
WHEN REGEXP_MATCH(Data Field A,"((?i).*Native Display).*")
THEN "PMP Dea"
ELSE "Non Standard Formats" END
In English:
If Data Field A contains text string PMP, please return results in column A as PMP Deal.
If Data Field A contains text string Native Display, pleas return results in column A as Native Display.

Kentico - Form Control Drop-down List & SQL Query

I couldn't make the title clearer, but here's what I need help with.
I have a custom page type [1] for Leaders which includes 2 fields: Name, and Title. This holds the list of all leaders at the company.
I have another custom page type [2] for Speaking Events, which includes a field called Speaker to display the speaker's name and title. This field was set up as a drop-down list with data source from a SQL Query to query the Leaders data in [1].
Select LeadersID, Name, Title from co_leaders order by Name
I got it work fine - the drop-down displays a list of Name. However, what I wanted to display in the drop-down option is: Name, Title (not just Name) like below so that I only pick one and have both Name and Title. Is it possible to do this?
John Doe, CEO
Jane Doe, CFO
Hope it's clear and thanks for your input!
This is the SQL you are looking for:
SELECT LeadersID, Name + ', ' + Title FROM co_leaders ORDER BY Name
You need to do a concatenation of the column values (Name and Title), as opposed to selecting the columns separately.
EDIT: This is assuming that Name and Title are not nullable fields.
If there is a NULL value in any of the concatenated fields, the end value will be NULL. In this case, you will need to use COALESCE (or an equivalent function) to define an alternative value. For example:
SELECT LeadersID, Name + ', ' + COALESCE(Title, 'Member') FROM co_leaders ORDER BY Name

Complicated condition

I have predefined item combination (for example brand1|brand2|brand3 etc) in the table.
i like to collect brands and check against with predefined table data.
For example i collected brand1|brand2|brand3 then i can do get some value form that predefined table(it meets the condition).
How can i check?
brands would be unlimited. also brand1|brand2|brand3 of brand1|brand2| exist then returns true.
Okay, taking a wild guess at what you're asking, you have a delimited field with brands in them separated by a | character. You want to return any row that has the right combination of the brands in there, but don't want to return rows with, for example, brand "testify" in them when you search for "test".
You have four search conditions (looking for brand3):
the brand exists by itself: "brand3"
the brand starts the delimited field: "brand3|brand4|brand6"
the brand is in the middle of the field: "brand1|brand3|brand6"
the brand is at the end of the field: "brand1|brand2|brand3"
so, in SQL:
SELECT *
FROM MyTable
WHERE BrandField = 'brand3'
OR BrandField LIKE 'brand3|%'
OR BrandField LIKE '%|brand3|%'
OR BrandField LIKE '%|brand3'
Repeat as required for multiple brands.

Resources