Applying a column based condition in an interactive report on first page load in Oracle APEX - sql

I have a requirement in Oracle Apex's Interactive report. At first load, only that data should appear whose Operation is not deleted. This should also reflect in the export of the report.
However, they want to provide an option that is user should be able to see the deleted operation data when they require. Please note, there is no Operation filter on the page. Can anyone please help.
Thanks in Advance.

Add a page item P1_SHOW_DELETED to the page. Set the page item value to default "N" (or set it to "N" with a computation before regions). Use "Select List" and give it values "Yes" and "No" (return values Y and N)
Update your query to use the page item. Make sure you have P1_SHOW_DELETED in "Page Items to Submit" attribute of the interactive report.
SELECT <columns>
FROM <tables>
WHERE <existing where clause> AND operation_deleted = :P1_SHOW_DELETED
At this point the delete rows will no be shown on page load - test and confirm.
Add a dynamic action on P1_SHOW_DELETED on change with a true action of type "Refresh" and region = your interactive report.
--- UPDATE ---
For multiple values for the operation column and you want to exclude/included the value "deleted", then this is an option.
SELECT <columns>
FROM <tables>
WHERE <existing where clause> AND
(('Y' = :P1_SHOW_DELETED AND operation = 'Deleted') OR (operation != 'Deleted'))

Related

Conditionally capturing pre-determined text in one field based on multiple choice selection in another field in REDCap

Problem: How can you capture a pre-determined or static text value based on what choice a user makes from a multiple choice menu on a survey?
Example: Suppose you have the following basic setup:
I have four text statements that correspond to options 1-4 (e.g., "Statement corresponding to Option 1", "Statement corresponding to Option 2", etc.). If the user chooses, say, Option 1 from the sample_options field, then I would like to capture the text value of the pre-prepared statement in the option_statement field. The user should not be able to alter the captured text statement (e.g., maybe hide the field using the #HIDDEN action tag).
Attempt: It seemed like this might be a problem that could be resolved with action tags, namely the #DEFAULT one, but I have been unable to do this. I also thought about trying to use a calculated field instead of a text field for option_statement, but calculated fields must return numeric values:
This seems like a problem that should be somewhat straightforward to tackle, but I have been baffled by just how hard it seems to be to simply capture static text in one field based on a user's selection in another field.
If I understand the question, you want to select a text string from a list of (in this case) 4 options, depending on the user selecting a choice from a radio/dropdown?
Probably the easiest method is to use #CALCTEXT (if you are on a sufficiently recent version), which allows you to conditionally populate a text field, i.e.:
#CALCTEXT(
if([sample_options] = 1, "This is the label for option 1",
if([sample_options] = 2, "This is the label for option 2",
if([sample_options] = 3, "This is the label for option 3",
if([sample_options] = 4, "This is the label for option 4", "This is an else value")
)
)
)
)
But if you do not have #CALCTEXT available to you, you can do this with a #DEFAULT, by constructing another radio field (#HIDDEN if you like) on a separate page or instrument (as #DEFAULT needs the value to exist in the database on page load, and so does not work dynamically on the page), with your four labels as the options with the same choice codes as your [sample_choices] field. For example:
1,This is the label for option 1
2,This is the label for option 2
3,This is the label for option 3
4,This is the label for option 4
And annotate it with:
#DEFAULT='[sample_choice]'
Thus if a user selects 3 for [sample_choice] and proceeds to the page or instrument that has the label field, the #DEFAULT tag will automatically select choice 3 from the label field, which can then be stored in the dataset and piped into an email, onto the page, or whatever.

How to wait untill drop down values load in if else condition in robot framework

My scenarios are: I have two drop down values side by side if the first drop down-selected based on the value selected second drop-down values will be loaded from that we need to pick one value. in one case from the first drop down if I select unknown or any legal purpose I should not go for the second dropdown. this is what the requirement I have please help me out. Below is the code I have written
Variables
${var1}= Unknown
${var2}= Any legal purpose
The user selects random NAICS code and subcode from the drop-down
${selectedNAICScode}= User selects NAICS code from the drop down
${NAICS_code} run keyword if
${selectedNAICScode}!=${var1} or ${selectedNAICScode}!=${var2} run keywords
... element should be visible xpath://select[#id="ddlNAICSSubCode"]
# ... is visible ${NAICS_subcode}
... User selects NAICS-sub code from the drop down
... ELSE run keywords
... element should not be visible xpath://select[#id='ddlNAICSSubCode']
Even though we are giving one argument when I run the script it is saying expecting 1 to 2 arguments but got 0. my question is how we can wait until the drop-down values load into the drop-down in else condition.
You can use the following functionality:
WebDriverWait wait = new WebDriverWait(driver, INSERT_INTEGER_WAITING_TIME);
boolean waitUntil = wait.until(ExpectedConditions.invisibilityOfElementLocated(By.xpath("ENTER_YOUR_XPATH_OR_OTHER_ATTRIBUTE")));
In this way, your action will happen only when the element is going to be visible.
If you need further information check this link

Work Queue - Updating Narrative(Status - Text) in Work Queue Item

Working on sample process work queue in Blue Prism. I am successfully able to process work queue items. However, I am not able to update queue items.
I am using calc stage where I am setting value as [RetrievedData.Status] = "Test", after this calling Set Data action (Passing RetrievedData collection and Item ID). When retrieving an item as Get-Item I am not able to see the updated value "Test" in Status column.
Can anybody please help.
Please see the attached screenshot]1
I am using calc stage where I am setting value as [RetrievedData.Status] = "Test"
No, you are currently testing whether [RetrievedData.Status] is equal to "Test" (and storing True/False to the data item Result). To set [RetrievedData.Status] to "Test", you need to use it like this:
are you using that specific item id for which you have updated data in 2nd get item? if not then 2nd get item will pick a new item from queue not the same item. Instead of using get item 2nd time you can use get item data action to verify the updated data

How to Select Choices input field having same class, type, Xpath everything is same

I have two input fields to enter choices which have same class, type. Id is different by it is dynamic and create on run time so i can't use id.I used indexing ,it's not working properly.
driver.findElement(By.xpath("//input[#type='text'][#placeholder='Provide a response entry that customers can select'][1]")).click();
driver.findElement(By.xpath("//input[#type='text'][#placeholder='Provide a response entry that customers can select'][1]")).sendKeys("Iphone 6");
driver.findElement(By.xpath("//input[#type='text'][#placeholder='Provide a response entry that customers can select'][2]")).click();
driver.findElement(By.xpath("//input[#type='text'][#placeholder='Provide a response entry that customers can select'][2]")).sendKeys("Iphone 7");
I used indexing in given image link.
click link to view code in organized way
Index 1 works in this case but unable to find index 2.
Given inspected html code is below of input field 1 and field 2
Field 1
Input field 1 image Xpath link
field 2
Input field 2 image link
If these two inputs are always in this sequence (so the first input is always first and second always second)
You can use:
driver.findElement(By.xpath("(//input[#type='text'][#placeholder='Provide a response entry that customers can select'])[1]")).click();
driver.findElement(By.xpath("(//input[#type='text'][#placeholder='Provide a response entry that customers can select'])[2]")).click();
At the same time I have corrected the syntax in indexing
Building on #Anand 's answer, you can simplify a little:
WebElement button1 = driver.findElement(By.xpath("(//input[#type='text' and #placeholder='Provide a response entry that customers can select'])[1]"));
WebElement button2 = driver.findElement(By.xpath("(//input[#type='text' and #placeholder='Provide a response entry that customers can select'])[2]"));
I think it's a little easier to read using and instead of stacking brackets.
I use it similarly for widgets:
WebElement header = driver.findElement(By.xpath("//div[contains(#class,'panel')]/div[contains(#class,'panel-heading') and text()[contains(.,'News Feed')]]"));

Question about oracle xe search query

this is my second time using ORACLE xe and Apex. Here is what I'm trying to do .. I'm trying to execute the following query SELECT * FROM EMPLOYEES WHERE JOB_TITLE = 'CLERK'
but not from sql command prompt but from gui/apex and here is how- I have created page one with one textfield and one submit button.
Now of course I'd type in the text field value CLERK and I'd like onclick on submit button that I be taken to page2 let say, and on that page2 to receive argument for the query. The query will be located at page2 of course.
I believe that this is fairly simple for someone who knows oracle, I know of course how I'd do this with PHP/Mysql its simple as it can be all I need is this :
#1 Get value from input
#2 Pass it to the next page using javascript or whatever
#3 Execute query on the next page using the value passed in where
Thank you, explanation tips hints link .. anything is welcome
You can refer to any item in an Apex application from any other page. For example, on page 1 you have an item P1_JOB_TITLE, then on page 2 you write a query like:
SELECT * FROM EMPLOYEES WHERE JOB_TITLE = :P1_JOB_TITLE;
(warning: make sure that page 1 doesn't have a "reset" process which would clear the value of the item when the page is submitted)
Note, however, that the item doesn't have to be on a different page if you don't want it to - you could have it on the same page as the report.