I am wondering how to use NSPredicateEditor to define subpredicates from out the user's perspective - and how to implement it.
Suppose we have a simple NSPredicateEditor created in IB as shown below.
It has 2 items to choose from:
lastname
address.street
So we can create a predicate like
lastname ==[c] "Smith" OR lastname ==[c] "Miller" OR address.street ==[c] "3rd Avenue"
Now, if I want to have only Millers selected, living in the 3rd Avenue, what can I do ? I would prefer to have a button like "s" to create a subpredicate just below the selected line (Miller) to get this result:
lastname ==[c] "Smith" OR (lastname ==[c] "Miller" AND address.street ==[c] "3rd Avenue")
Unfortunately, there is no other button than + or - for each item (row).
Is there any other way ? Can it be done with low programmatically effort ?
Set "Nesting" of the predicate editor to "Compound". At runtime: Press the Option Key and the + button will change to … for adding a compound row.
Related
I'm trying to update the "Email Sent" column once an email has sent. Once an email has been sent I want it to say "Sent" instead of "No"
I'm using the "update a row" action however, can't seem to have it updated. I'm not sure what I should enter for the "Key Value" because email can be sent for multiple rows at once. This is what I have so far but it is not working:
My Excel table:
When you use "Update a row", you need to specify a key column (the one with a unique id or value) so Power Automate can search a single row and update it.
Field "Key Column" is the column name where said ID is stored.
Field "Key Value" is the value to search for.
For example, in the following table:
Mentor ID
Email
Email_Sent
A001
someone#gmail.com
No
A002
someoneelse#gmail.com
No
If you wanted to update the first row, you'd need to specify Key Column = Mentor ID, and Key Value = A001.
I have a dynamic table displayed based on a value selected from a radio button in my project. The radio button field "Doctor Name" field has different choices like "Frank", "Michael", "Josh", "Jessica". When I select the "Frank" value, it displays a dynamic table with the list of appointments for "Frank", The first column in the table is "Doctor Name". When I select "Frank" from the radio button, I have to validate if all the appointments listed are for "Frank". So I have to write coding in cypress to check if all the first column cell values are "Frank".
How can I achieve this?
retrieve all the first columns using cy.get() with the proper selector, then use the each command to validate the content of each cell, something like this
cy.get("selector for first colums").each(($el, index, $list) => {
cy.wrap($el).contains('Frank')
})
I've got several fields in my document . Based on a dropdown-field I want to show / hide several other fields.
Told in another way. I have a dropdown that have these options "Custom", "As sunday", "Closed". If the dropdown value is "custom" then I should show the field "time". All the other options it should just print the dropdown value.
In my word file, it's like this
[dropdown] [time]
Ex: dropdown value is "custom", the field should be like below (only showing time):
0800 - 1600
Ex: dropdown value is "closed", the field should be like below (only showing the dropdown value):
closed
I've tried to use a formula like this:
{ IF "{dropdown}" = "custom", "", {dropdown} }
I think the problem is that "dropdown" field are changing when a user picks a value from the dropdown. is there a way to insert the value from the dropdown.. like REF "{dropdown}"
If you still don't understand what I'm trying to get.. told in the third way:
if the dropdown shows "Custom" I only want to display the time when the store is open.
if the dropdown shows anything else but custom it should just print the value of the dropdown, and leave the time "blank"
Assuming that you are using legacy form fields, only trying to change what is displayed, not what fields the user gets to enter (it's ambiguous as far as #"time" is concerned) then you need something like this:
{ IF "{ dropdownfieldname }" = "custom" "{ TIME }" "{ dropdownfieldname }" }
where
- all the {} are the special field code brace pairs that you can insert using ctrl-F9 on Windows Word
- dropdownfieldname is the name of the drop down field (set in its properties). It is possible to relocate this bookmark name in which case you will need to rename the dropdown a couple of times at develeopment time to re-impose it
- "custom" must be "custom" as written in the dropdown's list of values. i.e. if it's "Custom", use "Custom". Or use
{ IF "{ dropdownfieldname \*upper }" = "CUSTOM" "{ TIME }" "{ dropdownfieldname }" }
{ TIME } is the built-in time field. If you really want a reference to another form field value, that happens to have bookmark "time", you will probably need "{ ref time }" instead. If your field is actually called "timefield", use "{ timefield }"
If you are using Content controls, IMO the best way to do it is actually to create a custom XML part, link the dropdown result to an element in the part, link a plain text content control to the same element, and literally insert that control where I have put { dropdownfieldname }. Ditto for { timefieldm }
I have model User. One field in this model is gender. This field is integer. If user choose male I set 1, and if user chose female - I save this field as 0.
Also I have another models with the same problem in admin interface. For example in one of them I save day of week. It's very bad create some table with rows which will not change in future, but I doesn't have better solution
How I can make this better in active admin?
Get easy solution
column "Gender" do |user|
link_to (user.gender == 1) ? "Male" : "Female", "javascript:void(0)"
end
I'm trying to use an AdvancedDataGrid to display some grouped data. Normally flex displays this in a "tree view" with a folder icon represent the group. I need to group the data based on an integer ID field in my object, but I'd like the label for the folder icon to display the groupName field in my object.
Here's a little example:
{groupName: group1, ID: 1234}
{groupName: group2, ID: 5678}
<mx:grouping>
<mx:Grouping label="Group"> <--- The label of the whole column
<mx:GroupingField name="ID">
</mx:Grouping>
</mx:grouping>
Resulting output:
=== Group ===
+ 1234
- child
- child
+ 5678
...
But I'd really like to output:
=== Group ===
+ group1
- child
- child
+ group2
...
If anyone has any tips I'd appreciate it.
-- Dan
Have a look at GroupingField#groupingFunction. From the adobe docs:
A function that determines the label for this group. By default, the group displays the text for the field in the data that matches the filed specified by the name property. However, sometimes you want to group the items based on more than one field in the data, or group based on something that is not a simple String field. In such a case, you specify a callback function by using the groupingFunction property.
private function myGroupingFunction(value:Object, field:GroupingField):String