How to output only drop-downs with values (and give them a name) - Contact Form 7 - html

I'm trying to create a quote request form for a client using Contact 7 in Wordpress.
They've given me a couple of pages of products in a table and wants the user to be able to select an amount for each product from a drop-down and then have an email send to him telling him the user has requested a quote for the product(s) they selected in the form.
Ideally I would like only the items that have had a value selected to get sent in the email to my client.
Here's the setup I am using so far:
Product 1
[select menu-940 include_blank "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" ">10"]
Product 2
[select menu-941 include_blank "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" ">10"]
But many more lines of this. And the output code is:
[your-name] <[your-email]> is interested in the following products:
[menu-940]
[menu-941]
Of course just using the short code only displays a numerical value. Is there a way to have them show a text value and numerical value when there is a value selected, and not show at all if there is no value? Perhaps with a placeholder of some kind?
I have the "Exclude lines with blank mail-tags from output" box checked, so if menu-940 has no value, it won't be displayed; but still, a numerical value is of no use to anyone without some sort of identifier.
It would be awesome if I could get the drop-down to sit next to the name of the product in the form as well, as currently they take up an entire line each, making for a form that is twice as long as it needs to be.
Thanks a lot in advance. If this is hard to follow I'd be happy to provide more info.
Adam.

Take a look at this question: https://wordpress.stackexchange.com/questions/56042/contact-form-7-select-box-different-value-text-then-content-text-in-option
It will solve your problem with different value/text for drop-down options.
When it comes to displaying the drop-down to next to the name of the product, you should play around with CSS to position it right.

Related

Canvas app with SharePoint Data Source - Filter gallery on multi choice combobox

I have created a canvas app with SharePoint as data source. This is just a test list that I have created:
SharePoint List
In the list I have two columns - Title and Choice Column (This column is a multi choice column in SharePoint).
In my application I have created a gallery to display the records that I have created and one combo box field, which is taking the choices for the column in SharePoint:
Canvas Application
I have created the following filter for my gallery, so I can filter the gallery based on my combo box selection:
Filter('Test List', IsBlank(ComboBox1.SelectedItems)|| IsEmpty(ComboBox1.SelectedItems)|| ComboBox1.Selected.Value in 'Choice Column'.Value)
The filter is working correctly, if you choose only one value from the combo box field:
Filtered Gallery
The combo box items are displayed as follows:
Choices('Test List'.'Choice Column')
I would like to filter the gallery as follows:
If I choose "Choice 1", I would like to see all of the items where I have "Choice 1" selected. If I choose "Choice 1" and "Choice 2", I would like to see the records where I have "Choice 1" or "Choice 2" or both.
At the moment, when you select only "Choice 1", the filter is working. When you add "Choice 2", it is showing only the results, where I have "Choice 2".
I have tried many things like:
Filter('Test List', IsBlank(ComboBox1.SelectedItems)|| IsEmpty(ComboBox1.SelectedItems)|| Concat(ComboBox1.SelectedItems.Value, Value & " ") in Concat('Choice Column'.Value, Value & " "))
But this is not helping me, since it will look for an exact match: for example: If I choose "Choice 1" and "Choice 2", it will return the records where I have exactly "Choice 1", followed by "Choice 2":
Filter results
I have tried using the following filter as well:
ForAll(ComboBox1.SelectedItems.Value, Filter('Test List', Value in 'Choice Column'.Value))
But this is breaking the Gallery:
Gallery errors
In addition, I have tried the following:
Filter('Test List', IsBlank(ComboBox1.SelectedItems)|| IsEmpty(ComboBox1.SelectedItems)|| ComboBox1.SelectedItems in 'Choice Column')
But it is resulting in an error:
Error in Filter
Does somebody have an idea how the gallery can be filtered on multi choice field in SharePoint? Thank you in advance!

MS Access - Conditional Formatting in Continuous Form on Specific Cells

I'm working on Access and I have a question to ask on conditional formatting. As you can see in the picture I have 2 columns of data, L/I and Unit Price.
What I want to do is whenever there is duplicated L/I appearing in the data, conditional formatting will
highlight the duplicated L/I, and
compare on only the specific unit prices with duplicated L/I and show the cheaper price with green
font colour, yellow for price in the middle and red for the most expensive price.
I have done the first part as shown in the picture but I am clueless on the expression to be used for the second part. Not sure if I have articulated my concerns accurately but thanks in advance for attending to this question. Your help is sincerely appreciated.
What my continuous form looks like:
Maybe you could set the record source of the form to a query like beneath that generates a 'helper'-column with the name Indicator that is filled with the text "RED", "YELLOW" or "GREEN" according to their unit price characteristic. Based on this column, inside the form you could use conditional formatting to actually show the unit price in the wanted color. Hope this query helps (you in the right direction). I assumed the table is called "Items", you should change that to your naming.
SELECT i.ID, i.LI, i.UnitPrice, iif(i.UnitPrice = (SELECT MAX(il.UnitPrice) FROM Items AS il WHERE il.LI = i.LI), "RED", iif(i.UnitPrice = (SELECT MIN(il.UnitPrice) FROM Items AS il WHERE il.LI = i.LI), "GREEN", "YELLOW" )) AS Indicator FROM Items as i;

Microsoft Report Designer Line Through Text when value not Empty

Has anyone used LineThrough text on Microsoft Report Designer within the expression value?
Example:
=Switch(Fields!a.Value is Nothing, "text here".LineThrough, Not(Fields!a.Value is Nothing), CStr(Fields!a.Value))
I need the "text here" to be strikethrough if a.Value is nothing.
You need to use an expression to show the value you want and then Harry's answer to set the LineThrough.
You can simplify your SWITCH statement for the value like this..
=SWITCH(
Fields!a.Value Is Nothing, "Text Here",
True, Fields!a.Value)
or if the expression will not get any more complex than you have then use IIF
=IIF(Fields!a.Value Is Nothing, "Text Here", Fields!a.Value)
If you need only part of the textbox then the easiest way is to use placeholders. These act almost the same way as a textbox but you can have several placeholders in a single cell/textbox each with it's own properties.
To add a placeholder click the cell/textbox first to get focus then right-click before or after any existing text/placeholders. Select Insert placeholder and set the expression as you wish, you can also format the placeholders font/color/decoration etc.
As an example I've got a small dataset with country names. If the country contains the word "Island" then I show different text and change the text decoration on one of the place holders. In the design you can see there are 3 placeholders, some text then a field then some more text.
When I run this I get the following output.
I've set strike thru on the countrydesc field placeholder but you can do the same on a text placeholder. You still have to do it in two parts, and expression to set the text value and an expression in the placeholders font properties to set LineThrough
You can set the condition on the Font/ TextDecoration on the selected report Item. There is an option for LineThrough.
For Example
=iif(reportitems!Textbox7.Value = "Cartons","LineThrough","Default")

Way to add a calculated number of X's to a form input?

I have certain product codes with varying number of letters/digits e.g. 53HD6J, HH88WBD3 (varies between 5 to 10 letters/digits). In order for our barcode to scan these correctly there has to be 13 letters/digits. I don't want to make the user to input -XXXX after each code but rather have Access calculate the difference between 13 and the length of the code and fill the remaining with a X's. Is this possible either by vba or and expression?
I currently am using about 6 IIFs in one formula to fill remaining blanks with X's but hoping there is an easier way.
I have a form to enter in the batch number (product code). Once that form is submitted it links to a report that is printed. On the report are those batch numbers (53HD6J, HH88WBD3). The spot I want to have this feature is in a text box right next to the codes where Access determines the length of the codes and computes the remaining X's to add. This is in barcode font so this text box is where the 53HD6JXXXXXXX would go. Hope that clears it up!
So I have that part figured out. My problem now is my barcode font reads the text no matter what and translates it still so barcode shows up when the batch number is blank (I have four spots for batch codes to be inputted). So what I had before was =IIf([Text31]="",""&[Text31]&"","") which seemed to work. Hopefully I can continue this with the new formula. If that's unclear let me know.
**(The "" & & "" is so the barcode can be scanned).
My formula was wrong right above with the IIf. I figured it out! Forgot I had used ' Like "*" '. Thanks!
You can do what you want with String() and Left().
Here is an example from the Access Immediate window:
product_code = "53HD6J"
? product_code & String(13, "X")
53HD6JXXXXXXXXXXXXX
? Left(product_code & String(13, "X"), 13)
53HD6JXXXXXXX
Based on the update to your question, I think you can use that approach for the Control Source of a text box where you want to display the "expanded" product code.
Pretend your report has a text box named txtProduct_code where the raw product code, such as 53HD6J, is displayed. And there is a second text box where you want to display that value with the required number of X characters (53HD6JXXXXXXX).
Use this as the Control Source property of that second text box:
= Left([txtProduct_code] & String(13, "X"), 13)
Alternatively, you could make it a field expression in the report's Record Source query.
SELECT
product_code,
Left(product_code & String(13, "X"), 13) AS expanded_product_code
FROM YourTable;

MS ACCESS Multiple Record Visibility If Statement

I am building a form in Access 2013 and I will print out 4 fields for each record.
So Let's say the form processes 2 records it will print out:
Field 1 Field 2 Field 3 Field 4
Field 1 Field 2 Field 3 Field 4
Now I want to have it when it displays Other to print out the description of the other from a table. To do this I want the field named DefectType to go invisible and then the Other field to become visible. I start with Other being invisible and DefectType Visible and place them on top of each other. Here is the VBA:
If DefectType <> "Other" Then
DefectType.Visible = True
Other.Visible = False
Else
DefectType.Visible = False
Other.Visible = True
End If
It works fine if they are all other because what it does it takes the first record value of Other and applies it to all the other records for that field.
So if the first record that is displayed has a field 3 and it has a value of Other it will then look for the value in the table that is under the "other" field and display the content. SO lets say the "other" content was lamination. Instead of showing Other it will make that DefectType field invisible and show the "Other" field which will show Lamination.
The problem is it then does this for the rest of the records. It won't test to see if the field 3 is "Other" or not, it will just assume and then put it's "Other" field contents for the subsequent records. This means that since some actually already have values in them, like Corrosion, and nothing in the "other" field it will display a blank box.
I want it to test each field 3 as it is displayed so it can tell if "other" is in the field or not.
I'm unsure how well I understand your question, but it sounds to me that your form includes 2 text boxes named DefectType and Other. When the value of DefectType is "Other", you want to display the value from the Other text box. But when the value of DefectType is anything else, you want to display the value of DefectType.
If that is correct, you can create a new text box named txtSummary and use this as its Control Source property.
=IIf([DefectType] = "Other", [Other], [DefectType])
The txtSummary text box would not be editable. To change its value, you would change the values in DefectType and/or Other.
That approach will ensure txtSummary is always updated based on the current values of DefectType and Other in the same record. And it will do that for each record in the form, including when the form is in Continuous Form or DataSheet View.
Your original approach would do what I think you want only when the form is in Single Form view.